eiffel-community / eiffel-remrem-publish

eiffel-remrem-publish
https://eiffel-community.github.io/eiffel-remrem-publish
Apache License 2.0
8 stars 77 forks source link

producer/msg swagger status code 201 is actually 200 #204

Closed Isacholm closed 1 year ago

Isacholm commented 4 years ago

Description

Publishing an event using this endpoint returns the following:

{"events":[{"id":"2466ba4a-4540-4d22-b9e5-4565ac8de696","status_code":200,"result":"SUCCESS","message":"Event sent successfully"}]}

The API-documentation says:

HTTP Status Codes:
201 | Created
400 | Invalid event content
401 | Unauthorized
403 | Forbidden
404 | RabbitMq properties not found
500 | Internal server error
503 | Service Unavailable

The documentation should reflect reality or vice versa.

Motivation

Can cause confusion when developing tools using this endpoint.

Exemplification

Benefits

Possible Drawbacks

z-sztrom commented 1 year ago

Hi @Isacholm, where did you find the documentation? I checked https://github.com/eiffel-community/eiffel-remrem-publish/blob/master/wiki/markdown/usage/service.md which in turn points to https://github.com/eiffel-community/eiffel-remrem-publish/blob/master/wiki/markdown/statusCodes.md and this one says:

| 200 | SUCCESS | Event sent successfully | Is returned if the request is completed successfully.|

Of course, the documentation you found may have been updated as the issue is more than 2 years old...

z-sztrom commented 1 year ago

I found it, the status code displayed directly at swagger page. Confirmed.

z-sztrom commented 1 year ago

Solution available at https://github.com/z-sztrom/eiffel-remrem-publish/tree/swager-status-code.

The code 201 is not displayed any more. image

Note, that the success status code is displayed at the top of the endpoint section. image

I was unable to get the success status code to the list of all status codes. But it seems that this is feature of swagger-ui, as discussed at https://github.com/swagger-api/swagger-ui/issues/1505. image

z-sztrom commented 1 year ago

Waiting for #259 to be merged.