-
Notifications
You must be signed in to change notification settings - Fork 0
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
re-write the openapi file using asyncapi specification. #1
Comments
Let's try to convert this channel from https://github.com/Souvikns/server-api/blob/master/openapi.yaml to AsyncAPI document successfully. OpenAPI /validate:
post:
summary: Validate the given AsyncAPI document.
operationId: validate
tags:
- validate
- parser
externalDocs:
name: Github Repository for the AsyncAPI Parser
url: https://github.com/asyncapi/parser-js
requestBody:
description: Validate the given AsyncAPI document.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ValidateRequest'
responses:
"204":
description: The given AsyncAPI document is valid.
"400":
description: The given AsyncAPI document is not valid.
content:
application/json:
schema:
$ref: "#/components/schemas/Problem"
"422":
description: The given AsyncAPI document is not valid due to invalid parameters in the request.
content:
application/json:
schema:
$ref: "#/components/schemas/Problem"
default:
description: Unexpected problem.
content:
application/json:
schema:
$ref: "#/components/schemas/Problem"
AsyncAPI/validate:
tags:
- validate
- parser
operationId: validate
bindings:
http:
method: POST
publish:
$ref: '#/components/schemas/ValidateRequest'
subscribe:
payload:
responses:
type: object
properties:
204:
type: object
properties:
description:
type: string
400:
type: object
properties:
description:
type: string
content:
$ref: '#/components/schemas/Problem'
422:
type: object
properties:
description:
type: string
content:
$ref: '#/components/schemas/Problem'
default:
type: object
properties:
description:
type: string
content:
$ref: '#/components/schemas/Problem'
We can define the doc into AsyncAPI just feels a bit weird with the response, maybe we can handle it in glee, ask users to follow a standard format for responses in HTTP protocol. @KhudaDad414 what do you think? |
We have a standard format for AsyncAPI, it's called bindings. 😆 I think this problem runs deeper than this. We need to have a discussion on the http bindings. I see there are a few points already raised here asyncapi/bindings#2. |
Yeah I had tried to push this before and one thing we were trying to do was trying to reuse the open API schema here but it didn't work. you can look at asyncapi/bindings#131 |
So to rebuild this project with glee, the first step would be to convert the openapi file to AsyncAPI.
We might have some issues with certain parts of the spec like the response and multi-method support in aysncapi spec 2.0, but let's give it a try, if it is not possible then we could just create a WebSocket API instead.
The text was updated successfully, but these errors were encountered: