-
Notifications
You must be signed in to change notification settings - Fork 3
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
Generate messagebox api docs from message json schemas #4
Comments
Maybe it is also possible to generate a postman collection |
Interesting blog posts and tooling. |
@camuthig took a look at swagger but it cannot be used for a single http messagebox endpoint like Having said this the idea was to build our own UI that shows an API documentation based on messages and query responses described with JSON Schema as well as a way to send messages to that messagebox endpoint with some support on putting together the messages (auto. generated forms based on message schema) @camuthig Do you think something like this can work with swagger: POST POST Return Type/Response: {type: array, item: { ... }} for queries we could also do something like this: GET which is then added to the payload of the query message We just need to tweak the http message box endpoint a bit to support such requests. What do you think? And how should the message box schema look like to get swagger support? We can also simplify the schema and match it with http:
|
A couple of initial thoughts:
I'll put some effort towards a sample Open API document that might cover the needs and will link to it here. |
There are some layers of the Open API spec that don't exist in JSON schema, specifically some of the meta information, but I think we could create something similar to this using the JSON schema objects that are built inside of Event Machine: https://app.swaggerhub.com/apis/camuthig/event_machine/1.0.0 |
The sample looks great! I think we're on the right track. Can you list the tasks needed to add swagger support to event machine?
We don't make any assumptions on the namespace separator. User can decide what they want to use. Other characters are possible because for Event Machine and the message factory it is just a string. If someone wants to map "-" in Url to "." in message name this can be done with either a custom
Agreed. Let's support POST requests only.
Definitely 3.0. Another question: Your example includes two models: User and CreateUserInput. Thoughts? |
Maybe some useful tools: |
I'm fine with moving input types into standard types. The different provides less support with regards to JSON schema than it did for GraphQL. GraphQL could always be handled as a separate project, but I think it is best to focus on a single, solid API format for now. With that in mind, I think the needed work to get us towards Swagger docs is:
I may have missed some things, but that will definitely get us much closer. |
thx for the list @camuthig 👍 |
The master branch of event-machine-skeleton contains Swagger/OpenAPI support:
I did not modify internal JSON Schema handling of Event Machine but instead rewrite the JSON Schema returned by Doing it this way Event Machine does not need to know anything about OpenAPI v3. It can just use JSON Schema. The Event Machine message box already supports requests like Let me know what you think about it! |
new dev versions of event machine and skeleton released so we have a new base for further work.
|
swagger would be preferred if compatible with json schema draft 4
The text was updated successfully, but these errors were encountered: