Swagger UI Docs#
All BaSyx Go components can expose a Swagger UI and the corresponding OpenAPI specification via shared infrastructure in internal/common.
Default Endpoints#
The following endpoints are used by the shared Swagger UI setup:
.../swaggerfor the Swagger UI.../api-docs/openapi.yamlfor the OpenAPI document
If a component uses a contextPath, both endpoints are served below that base path (for example /my-component/swagger).
Base Path Redirect#
The shared Swagger setup also redirects the component base path to the Swagger UI:
/->/swagger(when nocontextPathis configured)/{contextPath}->/{contextPath}/swagger
Runtime OpenAPI Adjustments#
The shared Swagger setup can inject runtime values into the served OpenAPI document:
serversURL based onserver.host,server.port, andserver.contextPathinfo.contactbased onswagger.contactName,swagger.contactEmail, andswagger.contactUrl
When server.host is 0.0.0.0, the generated Swagger/OpenAPI server URL is rendered with localhost for display.