The other is a Compare with Last Specification Revision action, which you can invoke from the Find Action popup ( Cmd/Ctrl+Shift+A) and use to find any breaking changes introduced in the OpenAPI spec in your project. One is integration with the OpenAPI Code Generator, which you can use to create a library based on the API spec. The plugin has more useful features you can try I’ll highlight two of them. You can store the auth token and any other env variables in a special file – find our more about that in the WebStorm docs. Press Alt+Enter when the caret is on the URL in the fetch or axios method and then select Generate request. You can then use code completion suggestions to add additional parameters if needed.Īlternatively, you can create new requests using an intention right from the JavaScript or TypeScript file. If there is one, grab a direct link to the spec file and add that URL in the IDE Preferences/Settings.Īs you may already know, WebStorm has a built-in HTTP client that you can use to test REST APIs.įrom the OpenAPI spec file, you can quickly generate new requests in the format that the HTTP Client understands by clicking on the icon next to the method. If you’re using APIs of some 3rd-party service, you can check if there’s a community-maintained OpenAPI spec for it in the openapi-directory repository on GitHub (in the APIs folder). For that, go to Preferences/Settings | Languages and Frameworks | OpenAPI Specification, click the plus icon, and then paste the link to the JSON or YAML file. Having an OpenAPI spec right in your project is not the only way to benefit from these completion suggestions – you can also specify a URL where the spec is available. We’re planning to add support for Express methods soon.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |