Question: POST /rest/v1/distributionsets clarifications
MgmtDistributionSetRequestBodyPost does not define at least one required property and no default values applied implicitly if not passed explicitly schema wise. The example in the schema is:
[
{
"name": "dsOne",
"description": "Description of the distribution set.",
"version": "1.0.0",
"locked": true,
"requiredMigrationStep": false,
"modules": [
{
"id": 108
}
],
"type": "test_default_ds_type"
}
]
If I create a distribution set with the following request body (code wise the name and version are the only required props)
{
"name": "ds1",
"version": "1.0.0"
}
I get a response containing
"name": "ds1",
"id": 1,
"version": "1.0.0",
"type": "os_app",
"typeName": "OS with app(s)",
"complete": false,
"locked": false,
"deleted": false,
"valid": true,
"requiredMigrationStep": false,
which answers the question about implicit default values.
The lack of the info about required props and description about how complete, locked, deleted, valid work in the openapi spec schema is not critical. It implies the need for implicit knowledge however which makes working with the API pretty difficult. If someone knows about the behavior still involved in the project: Would it be possible to add this info into the related code (the openapi spec is generated from). I have guesses only...
If one tries to create a rollout with a distribution set as input this might lead to
{
"exceptionClass": "org.eclipse.hawkbit.repository.exception.IncompleteDistributionSetException",
"errorCode": "hawkbit.server.error.distributionset.incomplete",
"message": "Distribution set of type os_app is incomplete: 1"
}
It's not critical but user-unfriendly and we can improve the API usage experience by providing more complete API usage info in the openapi spec.