Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: VSCode command to download OpenAPI specification #2509

Open
shafreenAnfar opened this issue Dec 20, 2021 · 0 comments
Open

Proposal: VSCode command to download OpenAPI specification #2509

shafreenAnfar opened this issue Dec 20, 2021 · 0 comments
Labels
Area/Tooling module/http Status/Draft In circulation by the author for initial review and consensus-building Team/PCM Protocol connector packages related issues Type/Proposal

Comments

@shafreenAnfar
Copy link
Contributor

Summary

Ballerina HTTP service automatically generates the service description for each service. But there is no convenient way to retrieve it. This proposal is to address this concern.

Goals

  • Provide an convenient way to download OpenAPI specification

Motivation

As mentioned is the summary section, Ballerina HTTP services automatically generates service description for each service. The service description is captured in the form of OpenAPI Specification (OAS). However, to get the OAS you need to do the below.

Consider a service running on path foo.

curl host:9000/foo -v -X OPTIONS
HTTP/1.1 204 No Content
allow: OPTIONS, GET, HEAD, POST
date: Thu, 13 Oct 2016 11:45:00 GMT
server: ballerina
link: </foo/openapi-doc-dygixywsw>;rel="openapi-doc"

Once discovered user has to do the following.

curl host:9000/foo/openapi-doc-dygixywsw

NOTE: Related issue #1616

This can be simplified with a VSCode command as explained in the section.

Description

VSCode commands allows you to codify small work of units. Ballerina already has such commands.

Screen Shot 2021-12-20 at 9 21 54 AM

Similarly, another command named Ballerina: Download OpenAPI Specification can be added to the pallet. This command can simply download the service description from a given HTTP service. The command should take the URL of the service as the input.

Once executed, it should create a service-desc.yaml file with the OAS content in the root of the project directory.

@shafreenAnfar shafreenAnfar added Type/Proposal module/http Team/PCM Protocol connector packages related issues labels Dec 20, 2021
@shafreenAnfar shafreenAnfar added the Status/Active Proposals that are under review label Feb 23, 2022
@shafreenAnfar shafreenAnfar added Status/Draft In circulation by the author for initial review and consensus-building and removed Status/Active Proposals that are under review labels Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/Tooling module/http Status/Draft In circulation by the author for initial review and consensus-building Team/PCM Protocol connector packages related issues Type/Proposal
Projects
None yet
Development

No branches or pull requests

1 participant