OpenAPITools / OpenAPITools/openapi-generator
[Parser] Decouple code from Swagger-Core
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
I would like to investigate if it is possible to replace usage of
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-models</artifactId>
<version>2.0.6</version>
</dependency>
With the interfaces defined in Eclipse MicroProfile:
<dependency>
<groupId>org.eclipse.microprofile.openapi</groupId>
<artifactId>microprofile-openapi-api</artifactId>
<version>2.0-MR1</version>
</dependency>
To model existing OpenAPI specifications, the Eclipse MicroProfile is using a model that is really similar to what Swagger-Core is providing.
But it follows the JavaEE principle: there is a clear API with interfaces and different vendors can implement them.
With the release of the EMPOA project, we have a way to continue to use Swagger-Parser as we did before. EMPOA Swagger-Core is a bridge that implements the Eclipse MicroProfile interface by delegating to the Swagger-Core objects.
With this approach, the output of Swagger-Parser can be consumed as valid Eclipse MicroProfile implementation:
io.swagger.v3.oas.models.OpenAPI swaggerOpenAPI = parserResult.getOpenAPI();
OpenAPI openAPI = SwAdapter.toOpenAPI(swaggerOpenAPI);
Advantage of this approach: decoupling!
The EMPOA project could implement a second wrapper for the model used by KaiZen-OpenAPI-Parser.
This way we would have an alternative for corner cases that are not well supported by Swagger-Parser.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing Swagger-Parser's parserResult.getOpenAPI() output and its use of the swagger-models dependency. Compare that model with the MicroProfile OpenAPI interfaces and the EMPOA Swagger-Core bridge. Done means determining whether the direct Swagger-Core dependency can be replaced while preserving consumption through the MicroProfile model.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100