python-restx / flask-restx

Fork of Flask-RESTPlus: Fully featured framework for fast, easy and documented API development with Flask
https://flask-restx.readthedocs.io/en/latest/
Other
2.15k stars 331 forks source link

Vendor extensions in JSON API doc "info" object #222

Open robo3945 opened 4 years ago

robo3945 commented 4 years ago

How to include "x-" vendor extension in API DOCS Json "info" object.

It seems to me it's not possible to include vendor extension in the "info" attribute of the JSON Api Doc. Am I right? I'd like something like the following:

{ info : "my info", description: "my description", ... , x-first-vendor-extension, .... }

Reading the project docs I've seen only the possibility to expose the vendor extension as an endpoint.

Colin-b commented 3 years ago

Hello, you can do it the way I did it by creating a custom API: https://github.com/Colin-b/layab/blob/1b700f2681b39f77f35be56564990d6e3fe982d3/layab/flask_restx.py#L19

I was planning on submitting a PR to this project to allow this anyway.

robo3945 commented 3 years ago

I'll read your suggestion, thx.

I've solved implementing an interceptor for the api-docs and put inside it the requested "x-" vendor extensions.