Add server URL to OpenAPI schema #9654

Closed
opened 2025-12-29 21:20:25 +01:00 by adam · 2 comments
Owner

Originally created by @abhi1693 on GitHub (May 11, 2024).

NetBox version

v3.7.8

Feature type

Change to existing functionality

Proposed functionality

Incorporate the server's base URL into the OpenAPI schema by adding it to the 'servers' object. This modification will automate the configuration of the base URL for API clients. Specifically, this change should include:

  • Definition of a default server URL in the OpenAPI configuration.
  • Ensuring that this URL is referenced as the base path for all API calls within the NetBox API documentation and schema.
  • Providing flexibility for users to override the default URL if their deployment requires a different configuration.

This update will streamline the API client setup process by pre-defining the server URL, thereby eliminating the need for users to manually specify this setting during client configuration.

Use case

Adding the server URL to the 'servers' object in the OpenAPI schema enhances the utility of the NetBox API by explicitly defining the base URL for all API endpoints. This change addresses the issue where clients of the NetBox API need to manually configure the base URL, which can lead to errors and inconsistencies, especially in environments where NetBox instances are dynamically created and managed. By specifying the server URL in the schema, client applications can automatically adapt to changes in the server's location without requiring manual updates. This makes the API more robust and easier to integrate with, improving user experience and supporting more dynamic, cloud-based environments where the URL might change frequently.

Database changes

No response

External dependencies

No response

Originally created by @abhi1693 on GitHub (May 11, 2024). ### NetBox version v3.7.8 ### Feature type Change to existing functionality ### Proposed functionality Incorporate the server's base URL into the OpenAPI schema by adding it to the 'servers' object. This modification will automate the configuration of the base URL for API clients. Specifically, this change should include: - Definition of a default server URL in the OpenAPI configuration. - Ensuring that this URL is referenced as the base path for all API calls within the NetBox API documentation and schema. - Providing flexibility for users to override the default URL if their deployment requires a different configuration. This update will streamline the API client setup process by pre-defining the server URL, thereby eliminating the need for users to manually specify this setting during client configuration. ### Use case Adding the server URL to the 'servers' object in the OpenAPI schema enhances the utility of the NetBox API by explicitly defining the base URL for all API endpoints. This change addresses the issue where clients of the NetBox API need to manually configure the base URL, which can lead to errors and inconsistencies, especially in environments where NetBox instances are dynamically created and managed. By specifying the server URL in the schema, client applications can automatically adapt to changes in the server's location without requiring manual updates. This makes the API more robust and easier to integrate with, improving user experience and supporting more dynamic, cloud-based environments where the URL might change frequently. ### Database changes _No response_ ### External dependencies _No response_
adam closed this issue 2025-12-29 21:20:25 +01:00
Author
Owner

@github-actions[bot] commented on GitHub (Apr 25, 2025):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Apr 25, 2025): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/main/CONTRIBUTING.md).
Author
Owner

@abhi1693 commented on GitHub (May 3, 2025):

This seems to have been implemented already in a newer version

@abhi1693 commented on GitHub (May 3, 2025): This seems to have been implemented already in a newer version
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9654