A VSCode extension that scaffolds openAPI (swagger) specs from your editor.
Get it on the VSCode Marketplace.
Got any feedback, issues or feature requests? Send them my way via GitHub Issues.
See the CHANGELOG for the latest changes.
Commands
Command name |
Description |
Shortcut |
swagger-tools.pasteSchema |
Generates an openAPI schema from an object or array in the clipboard |
ctrl/cmd + alt + v |
swagger-tools.addComponent |
Adds an openAPI schema into the components spec field (optionally generated from clipboard) |
ctrl/cmd + alt + c |
Settings
Settings → Extensions → Swagger Tools
Setting |
Description |
Allowed Values |
swagger-tools.arrayType |
Specify the type of array you want auto generated |
"anyOf", "oneOf", "allOf", "not" |
Features
Generate & Paste Schema Object
- Copy the object or array you would like to generate
- Go to the desired openAPI spec file
- Place your cursor where you would like to paste your schema
- Paste by typing the macro
ctrl/cmd + alt + v
Generate Components
Select from a list of components to generate fully scaffolded schemas.
The schemas will be auto inserted in its proper field.
- Copy the object or array you would like to generate as a component schema
- Go to the desired openAPI spec file
- Paste by typing the macro
ctrl/cmd + alt + c
- Fill out schema info in command pallette
Upcoming Features
The upcoming features list is order by expected release date...
Scaffold New Spec
An easy and quick set up for anyone on the team.
- Scaffold a new spec from scratch
- Choose between a complex or basic spec
Generate Components Continued...
Select from a list of components to generate fully scaffolded schemas.
The schemas will be auto inserted in its proper field.
Upcoming Releases:
- responses
- parameters
- examples
- requestBodies
- headers
- securitySchemes
- links
- callbacks
Generate Paths
Fully generate paths with all their required fields.
GET, POST, PUT, PATCH, DELETE
More to come...
- Auto populate paths with request bodies, params, responses, etc...
- Linting
- Error decorators
Author
Created and sustained by Aaron Turkel (a.k.a. The Holy Coder).
Contributors
Have an idea that could make Swagger Tools better? Contribute!