Skip to content

Add a REST API OpenAPI specification #972

Closed
devfile/registry-support
#175
@schultzp2020

Description

@schultzp2020

Which area this feature is related to?

/area api
/area registry

Which functionality do you think we should add?

Why is this needed? Is your feature request related to a problem?

As a developer, it would be easier to update the REST API if we had defined OpenAPI specification that codegens the the index server with the corresponding bindings. This would create a better workflow to understand what each route does. In addition, this would allow for better documentation and automated mock testing.

As a consumer, it would easier to consume the REST API if the documentation was clear and always up-to-date. In addition, this change would allow codegen of nonvendored types between languages Edit: After #1146 is completed.

Describe the solution you'd like

1. Use json-schema-to-openapi-schema to convert the devfile JSON schema to the OpenAPI schema. Covering this in #1146.
2. Create the REST API OpenAPI schema with the devfile OpenAPI schema reference to the Go schema of the devfile specification.
3. Use oapi-codegen to codegen the index server with the corresponding bindings.

For more information on JSON schemas and OpenAPI schema read this.

Describe alternatives you've considered

We could codegen the OpenAPI specification from the source code. However, it is better convention to create the spec and then the source code.

Additional context

blocks #957

Target Date: 07-11-2023

Metadata

Metadata

Labels

R&Darea/apiEnhancement or issue related to the api/devfile specificationarea/registryDevfile registry for stacks and infrastructure

Type

No type

Projects

Status

Done ✅

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions