Include JS OpenAPI from app.json in /api responses#1874
Merged
Conversation
|
js_dynamic_openapi@15316 aka 20201111.20 vs master ewma over 50 builds from 14780 to 15305 |
achamayou
approved these changes
Nov 11, 2020
letmaik
reviewed
Nov 13, 2020
| "application/json": { | ||
| "schema": { | ||
| "items": { | ||
| "items": {}, |
Member
Author
There was a problem hiding this comment.
The validator we're using doesn't like this empty object - it doesn't think this matches the schema for a JSON schema object. So we say the same thing ("the items have no further type restriction") by omitting the field entirely.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The endpoints table now stores the
openapielements defined for each endpoint inapp.json, and merges these into the resulting document duringbuild_api.The
modules.pytest retrieves the OpenAPI docs for the tested JS apps, and checks that they're valid OpenAPI. This required a few minor changes to the existingapp.jsonfiles.To support this I've updated the Lua JSON converters, so they can correctly roundtrip an empty object or empty array. This is done by adding a magic field to the metatable on the pushed table. Its an ugly solution, but does what we need for now, while we're still reliant on Lua.