You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FR]Add servers section to the OpenAPI schema #6350
Please verify that this feature request has NOT been suggested before.
I checked and didn't find a similar feature request
Problem statement
As I mentioned in the #4587 some of the openapi-codegen generators (Qt/C++ client generator for sure) expects the servers section to be present in the schema descriptor yaml file, because they generating the API endpoints to the code.
The InvenTree generated schema lacks it so it has to be manually extended before generating code.
Suggested solution
It would be straightforward to add the servers section into the SPECTACULAR_SETTINGS in the settings.py, however I have no idea how can I 'smuggle' the re the base url.
@martonmiklos you are asking for the ability to have the local instance base URL in the servers section? as in, when you run invoke schema locally, the "server" will include your server URL?
@SchrodingersGat well I was not aware of the local invoke server command I have used the /schema/ endpoint so far. It would be good if via that endpoint the servers section would be filled with the same url base through what I downloading the schema.
Activity
matmair commentedon Jan 28, 2024
There is an active PR for openApi generation, maybe feedback regarding the schema should be placed there: #6319
SchrodingersGat commentedon Feb 10, 2024
@martonmiklos you are asking for the ability to have the local instance base URL in the servers section? as in, when you run
invoke schemalocally, the "server" will include your server URL?martonmiklos commentedon Feb 10, 2024
@SchrodingersGat well I was not aware of the local
invoke servercommand I have used the /schema/ endpoint so far. It would be good if via that endpoint the servers section would be filled with the same url base through what I downloading the schema.SchrodingersGat commentedon Feb 10, 2024
Check out this PR - #6463 - I have made a change which allows this to be filled out, if you have a globally defined SITE URL
SchrodingersGat commentedon Mar 2, 2024
Closed by #6463