OpenAPI Format
Learn how to use OpenAPI (Swagger) specifications with moclojer. Import your OpenAPI 3.0/3.1 specs and generate mocks automatically.
What Is OpenAPI?
Why Use OpenAPI with Moclojer?
OpenAPI Support in Moclojer
Supported Versions
Accepted Formats
Quick Start
1. Create or Get an OpenAPI Spec
2. Start Moclojer with OpenAPI
3. Test
How Moclojer Converts OpenAPI
Automatic Conversion
Path Parameters
Query Parameters
Request Body
Complete OpenAPI Examples
Example 1: Simple User API
Example 2: E-commerce API
Multiple Responses by Status Code
Headers and Content-Type
Schemas and $ref
Security Schemes (Authentication)
Useful Tools
OpenAPI Editors
Spec Validation
Spec Generation
Limitations and Workarounds
1. Request Validation
2. Multiple Responses by Status
3. Callbacks and Links
4. oneOf, anyOf, allOf
OpenAPI vs Native Moclojer YAML
Aspect
OpenAPI
Moclojer YAML
Combining OpenAPI + Moclojer YAML
Best Practices
β
Do
β Avoid
Troubleshooting
"OpenAPI spec not detected"
"No examples found"
"Path parameters not working"
Next Steps
See Also
Last updated
Was this helpful?