Skip to content

Browse and test a REST API described with the OpenAPI 3.0 Specification

License

Notifications You must be signed in to change notification settings

data-fair/openapi-viewer

Repository files navigation

OpenAPI 3 viewer

This service is designed to easily browse and test a REST API described with the OpenAPI 3.0 Specification.

Sponsors

Click here to support the development of this project.
Koumoul logo Koumoul develops the Data Fair ecosystem and hosts it as an online service.
Dawizz logo Dawizz uses the Data Fair ecosystem inside its platform and supports its development.

Query parameters

You can use the followings query parameters to prefill the viewer :

Available Parameters

  • drawerLocation : The location of the navigation-drawer. Can be left or right. Defaults to left.
  • urlType : The type of the URL defined in the environment variable ALLOWED_URLS.

Examples of ALLOWED_URLS :

{
  "exampleYaml": "https://example1.com/openapi.yaml",
  "exampleWithUrlTemplate": "https://example2.com/{id}/openapi.json"
}

⚠️ Deprecated: url and hide-toolbar are deprecated.

  • url : The location of the API documentation file to load, in OpenAPI v3 JSON format.
  • hide-toolbar : true or false to hide the toolbar (useful for iframe integration). Defaults to false.

Directly Linking to an API Operation

You can append a query parameter operation with an operationId as its value to directly navigate to a specific API operation. Reference : OpenAPI 3.1 Operation Object

⚠️ The hash part of the URL has been replaced by the query parameter operation.

Integration with SimpleDirectory

By default, the viewer is designed to work seamlessly with SimpleDirectory.
This ensures full integration with the ecosystem where it is deployed, including:

  • Theming: Automatically adapts to the platform's look and feel.
  • Language: Uses the same language settings as the environment.

Standalone Mode

If you want to disable this integration and run the viewer in standalone mode, set the environment variable:

USE_SIMPLE_DIRECTORY=false

Developers

Take a look at the contribution guidelines.