Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #2111
Closed
Open
Issue created Feb 11, 2019 by Administrator@rootContributor

[Parser] Decouple code from Swagger-Core

Created by: jmini

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.

Assignee
Assign to
Time tracking