Closed mkanoor closed 4 years ago
@eclarizio The openapi generator doesn't have any specs, It runs thru app/models and generates an openapi.json for sources and topology. The changes in this PR is part of a precanned section that is inserted into the openapi.json file. This is only for documentation purposes when an error is sent out from the api-server we create an ErrorDcoument that conforms to this spec. It becomes part of the HTTP response body and at that point it doesn't matter if its a string or an integer.
We do have failures when we test the error response from a api request. They are handled separately in this PR https://github.com/RedHatInsights/sources-api/pull/219
There are tons of failure that is being fixed in that PR.
This PR just fixes the documentation aspect of it so that we dont keep inserting the precanned object with integer status.
To conform with the IPP and the JSON API error object format the generator should be using string for status.
https://jsonapi.org/format/#errors
This PR updates the pre-canned type used by the generator used by topology and sources when they generate the openapi.json so it can create the JSON API conformant type.
https://github.com/RedHatInsights/sources-api/blob/8782d2103bed61c40b547603089c0978624950e1/public/doc/openapi-3-v3.0.json#L1780