Spot OpenAPI Specification is a static site built using OpenAPI definitions and powered by ReDoc.
- Requirements
- Local Development
- Build Artifacts
- Getting Help
- Community
- Contributing
- License
- Adding a New Documentation Section
- Start the ReDoc webserver (available at http://localhost:8080):
# using yarn
$ yarn serve
# using docker
$ make serve- Validate the API definition against the OpenAPI schema:
# using yarn
$ yarn validate
# using docker
$ make validate- Make a static HTML file with ReDoc:
# using yarn
$ yarn bundle:redoc
# using docker
$ make bundle-redoc- Make a single JSON bundle of the OpenAPI spec:
# using yarn
$ yarn bundle:swagger
# using docker
$ make bundle-swaggerWe use GitHub issues for tracking bugs and feature requests. Please use these community resources for getting help:
- Ask a question on Stack Overflow and tag it with spot-openapi.
- Join our Spot community on Slack.
- Open an issue.
Please see the contribution guidelines.
Code is licensed under the Apache License 2.0.
The documentation is automatically split into sections based on x-tagGroups in api/spot.yaml.
First, ensure your API endpoints have tags defined in their path files under api/services/:
# Example: api/services/myservice/paths/endpoint.yaml
get:
tags:
- My New Service
summary: Get something
# ...Add the tag definition in api/spot.yaml under tags::
tags:
# ...existing tags...
- name: My New Service
description: Description of my new service
externalDocs:
description: My Service Documentation
url: https://docs.flexera.com/spot/myservice/Add a new group in api/spot.yaml under x-tagGroups: with x-folders to specify which service folders to include:
x-tagGroups:
# ...existing groups...
- name: My New Section
x-folders:
- myservice/
tags:
- My New Service
- Another Related TagThe x-folders array specifies which folders under api/services/ contain the paths for this section.
yarn serveYour new section will appear in the left menu automatically.
| File | Purpose |
|---|---|
api/spot.yaml |
Main spec with tags, x-tagGroups, and x-folders |
api/services/*/ |
Service-specific paths, schemas, responses |
scripts/build-sections.js |
Generates split YAMLs per section (reads from x-tagGroups) |
scripts/build-landing.js |
Generates landing page with menu |
Spot API uses standardized response wrappers to maintain consistency across all endpoints. When creating response schemas, follow these patterns:
responseWrapper.yaml- Base wrapper withrequestandresponse.statuspropertiesresponseItemWrapper.yaml- Extends base wrapper, addscountandkindpropertiespaginatedResponseItemWrapper.yaml- Extends item wrapper, addspaginationInfo
The common response wrappers (responseItemWrapper.yaml and paginatedResponseItemWrapper.yaml) do not include the response.items array. This is intentional to allow each endpoint to define its specific item type.
❌ Incorrect Usage (Missing items):
# api/services/myservice/responses/myResponse.yaml
description: My Response
content:
application/json:
schema:
$ref: "../../../commons/schemas/responseItemWrapper.yaml"✅ Correct Usage (Explicit items Definition):
# api/services/myservice/responses/myResponse.yaml
description: My Response
content:
application/json:
schema:
allOf:
- $ref: "../../../commons/schemas/responseItemWrapper.yaml"
- type: object
properties:
response:
type: object
properties:
items:
type: array
items:
$ref: "../schemas/myItemSchema.yaml"
kind:
example: spotinst:myservice:item- Type Safety: Each endpoint explicitly defines its item schema, enabling better code generation
- Flexibility: Different endpoints can return different item types without conflicts
- Validation: OpenAPI tools can validate the specific schema for each endpoint
- Documentation: Generated docs show the exact response structure for each endpoint
When creating a new response that returns a list of items:
- Use
allOfto extendresponseItemWrapper.yamlorpaginatedResponseItemWrapper.yaml - Define
response.itemsas an array with a specific item schema reference - Define
response.kindwith an example value following the pattern:spotinst:service:itemType - If paginated, ensure you're using
paginatedResponseItemWrapper.yaml
# api/services/elastigroup/aws/responses/groups.yaml
description: Elastigroup Response
content:
application/json:
schema:
allOf:
- $ref: "../../../../commons/schemas/responseItemWrapper.yaml"
- type: object
properties:
response:
type: object
properties:
items:
type: array
items:
$ref: "../schemas/elastigroup.yaml"
kind:
example: spotinst:aws:ec2:group