The Vilna API is fully documented using OpenAPI 3.1 specification, enabling automatic client generation and integration with popular API tools.
The OpenAPI specification is available at:
- API Reference: /apis/spec.yaml
- Format: OpenAPI 3.1
- Schema: JSON Schema Draft 2020-12
Generate client libraries for your preferred programming language using OpenAPI Generator:
# Install OpenAPI Generator
npm install -g @openapitools/openapi-generator-cli
# Generate a client (example for Python)
openapi-generator-cli generate \
-i path/to/spec.yaml \
-g python \
-o ./vilna-python-clientSupported languages include Python, JavaScript, TypeScript, Go, Java, C#, PHP, Ruby, and many more.
Alternative client generation using Swagger Codegen:
# Generate a client (example for Java)
swagger-codegen generate \
-i path/to/spec.yaml \
-l java \
-o ./vilna-java-clientUse Swagger UI to visualize and interact with the API:
- Import the OpenAPI specification
- Explore available endpoints
- Test API calls directly from the browser
- View request/response schemas
Import the specification into Postman:
- Open Postman
- Click "Import" → "File"
- Select the OpenAPI specification file
- Postman will create a collection with all endpoints
- Configure your API key in the collection variables
Use Insomnia for API debugging:
- Create a new Document in Insomnia
- Import the OpenAPI specification
- Configure authentication
- Test endpoints with auto-completion
Generate TypeScript types from the OpenAPI specification:
# Using openapi-typescript
npx openapi-typescript path/to/spec.yaml --output vilna-types.tsLearn more at openapi-typescript.
Validate requests and responses against the OpenAPI specification:
- Node.js: express-openapi-validator
- Python: openapi-core
- Go: kin-openapi
Create a mock server for development and testing:
# Using Prism
npm install -g @stoplight/prism-cli
prism mock path/to/spec.yamlLearn more about Prism Mock Server.
Generate API documentation from the specification:
- ReDoc: ReDoc
- Slate: widdershins + Slate
- MkDocs: mkdocs-openapi
Install the OpenAPI (Swagger) Editor extension for:
- Syntax highlighting
- Auto-completion
- Validation
- Preview
Use the built-in OpenAPI Specifications plugin for:
- Code generation
- Endpoint navigation
- Request testing
- Version Control: Always specify the API version when generating clients
- Validation: Validate your implementation against the specification
- Updates: Regenerate clients when the API specification is updated
- Custom Templates: Use custom templates for generated code when needed
- Testing: Use the specification for contract testing
The OpenAPI specification is the source of truth for the Vilna API. All tools and generated clients should be based on this specification.