summaryrefslogtreecommitdiffstats
path: root/openapi
Commit message (Collapse)AuthorAgeFilesLines
* openapi: also consider Object type as validBenjamin Tissoires2020-06-171-1/+4
| | | | | Not sure if this will end up in a correct openapi file, but the docs are correctly generated, so... meh.
* openapi: fix jsdoc/operation matchingBenjamin Tissoires2020-06-171-2/+10
| | | | | | | | | | | | | | | | The script was considering that the operation associated to a jsdoc was declared on the line just after the end of the jsdoc. Turns out that adding new lines makes the code clearer, but the python script was then ignoring some jsdocs. Change the behaviour to consider that the jsdoc associated with an operation is the last one declared after the end of the previous operation. Fixes #3169
* generate_openapi: fix enums when they are declared as constBenjamin Tissoires2019-11-051-1/+35
| | | | Fixes: #2781
* generate_openapi: print a more useful errorBenjamin Tissoires2019-11-051-21/+43
| | | | ...when we can not parse a SchemaProperty
* generate_openapi: add a little bit more verbosity when we get an ErrorBenjamin Tissoires2019-11-051-10/+40
|
* generate_openapi.py: use the logging moduleBenjamin Tissoires2019-11-051-13/+25
| | | | | Instead of dealing with custom writes to stderr, it's always better to rely on standard libraries.
* openAPI: also handle `export` statement in the scriptsBenjamin Tissoires2019-05-141-1/+1
| | | | | | The files are actually modules, not plain scripts, and thus we are allowed to use `export`. Without `parseModule`, the script would silently fail when parsing `export.js` and the export function will not be present.
* - More whitelabeling.Lauri Ojansivu2019-03-211-1/+1
| | | | Thanks to xet7 !
* openapi: make the code python 3.5 compatibleBenjamin Tissoires2019-01-181-68/+72
| | | | | | | | | | It is common to use Ubuntu 16.04 to build snaps. For example, the official docker container to build snaps is using this old distribution. However, Ubuntu 16.04 ships Python 3.5.X which is not compatible with the f-strings in generate_openapi.py. This is sad, because we need to use the `.format()` syntax to make it compatible.
* Add OpenAPI description of the REST APIBenjamin Tissoires2019-01-182-0/+938
The API is generated by a custom script that parses the models directory. Once the API is generated, tools like https://editor.swagger.io/ or Python bravado can parse the file and generate a language friendly API. Note that the tool generate an OpenAPI 2.0 version because bravado doesn't handle OpenAPI 3.0. The script also parses the JSDoc with a custom parser to allow customization of the description of the fields.