Skip to content

[FR]Add servers section to the OpenAPI schema #6350

Closed

Description

@martonmiklos

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.

Describe alternatives you've considered

Adding manually.

Examples of other systems

Do you want to develop this?

  • I want to develop this.

Activity

  1. added
    enhancement
    triage:not-checked
    on Jan 28, 2024
  2. matmair commented on Jan 28, 2024

    @matmair
    Member

    There is an active PR for openApi generation, maybe feedback regarding the schema should be placed there: #6319

  3. removed
    triage:not-checked
    on Jan 28, 2024
  4. SchrodingersGat commented on Feb 10, 2024

    @SchrodingersGat
    Member

    @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?

  5. martonmiklos commented on Feb 10, 2024

    @martonmiklos
    ContributorAuthor

    @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.

  6. SchrodingersGat commented on Feb 10, 2024

    @SchrodingersGat
    Member

    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

  7. SchrodingersGat commented on Mar 2, 2024

    @SchrodingersGat
    Member

    Closed by #6463

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions