adewg / ICAR

Standard messages and specifications for animal data exchange in livestock.
https://icar.org/
Apache License 2.0
49 stars 26 forks source link

replaced default error with codes #302

Closed gra-moore closed 2 years ago

gra-moore commented 2 years ago

I have added 400 and 500 error codes instead of the default. However, on reflection 400 probably doesnt make much sense for the get requests. Thoughts?

AndreasSchultzGEA commented 2 years ago

Hi Graham, this changes sth, but not in a desired way. I think, as long as we do not add a reference to a entity/object/class, the annotated hander-class will stay wrong. look at GetPregnancyChecks400Response @Operation( operationId = "getAbortions", summary = "Get the abortions for a certain location", tags = { "ADE-1.2-reproduction" }, responses = { @ApiResponse(responseCode = "200", description = "Successful. The response contains the resources for the given location.", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = IcarReproAbortionEventCollection.class)) }), @ApiResponse(responseCode = "400", description = "An error has occured while handling the request. Check the content of the message for the error details.", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = GetPregnancyChecks400Response.class)) }), @ApiResponse(responseCode = "500", description = "An error has occured while handling the request. Check the content of the message for the error details.", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = GetPregnancyChecks400Response.class)) }) } )

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

cookeac commented 2 years ago

Replaced with PR #321