-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix, test and document openapi named examples #639
Conversation
39b69e1
to
38547e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, one weird thing I noticed.
|
||
["/pizza" | ||
{:get {:summary "Fetch a pizza | Multiple content-types, multiple examples" | ||
:content-types ["application/json" "application/edn"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait what? when and why did we add the :content-types
? isn't the map keys in :content
the correct source of supported types? I feel this is duplicate info which can can cause hard to track errors, e.g. defining inputs for multiple content-types under :content
and not setting this value will cause only "application/json"
to be supported (the default from code).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.g. this is not part of OpenAPI Spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:content-types
is there as the analogue of :swagger {:produces [...]}
. It's not directly copied to the openapi spec, but is used when expanding the :default
content type. Openapi doesn't support a default
case so we need to list out all the supported content types.
The list could be fetched from muuntaja when we do #636
That said, this is probably not needed here, so I'll remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, for the :post
case it is needed since it uses a :default
case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed one :content-types
, added a comment for the other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, one spec-error (we don't use the keys in tests I presume)
`#{}` isn't a valid :kind predicate
also fixed |
no need to insist on set, and many of our examples use vectors anyway
leftovers from #627
related to #84