Replies: 1 comment
-
I am pretty sure this is a bug. Thanks, I filled an issue: #1373. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The
compareResponses
method effectively does a deep equal check by marshaling the JSON and comparing their byte array. This means that if you've defined a schema with a standard error type, but provide relevant example errors for different endpoints, ogen doesn't generate a convenient error handler.I seems like you could safely drop the
example
andexamples
properties off thecontent
before doing the comparison. (Relevant OpenAPI schema spec forMedia Type Object
)Bonus Points
If the comparison did an equality check to see that the
$ref
'd object was of the same shape as the manually defined response, you could mix default responses and ones with specific examples.Example OpenAPI 3.1 schema
The following spec only defines a single error type, and all the
default
responses are technically equal, but the comparison checker deems them different by doing a deep equality check.Beta Was this translation helpful? Give feedback.
All reactions