-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
Run npx apib2swagger -i blueprint.apib --open-api-3 on this apib:
FORMAT: 1A
HOST: http://example.org
# My Title
This is some blueprint
# Group A Group
## Some URL [/some/url]
### Some super awesome endpoint [PUT]
+ Request
+ Attributes (object)
+ Response 200
+ Attributes (object)
Expected result: not sure actually (see details)
Actual result:
TypeError: Cannot read properties of undefined (reading 'value')
at setResponseSchema (.../node_modules/apib2swagger/src/responses.js:92:28)
Details:
I can make it work by either:
- changing the
iftoif (contentTypeHeader === undefined || !contentTypeHeader.value) - Response 200 (application/json)
but I can't figure out whether
- the response should always have a content type, or
- the response does not necessarily need to have a content type
because on the one hand there's an if check that I think is just supposed to return if it doesn't have a content type? The API blueprint docs would also suggest that this is valid?
- https://apiblueprint.org/documentation/specification.html#request-section
- https://apiblueprint.org/documentation/specification.html#response-section
- https://apiblueprint.org/documentation/specification.html#payload-section
on the other I'm also fine with having to explicitly set them since it's not bad to do so, but in that case the error should be made clearer.
Metadata
Metadata
Assignees
Labels
No labels