OpenAPITools / OpenAPITools/openapi-generator

[REQ] Map OpenAPI essential details to Camel REST-DSL

Open
#20,429 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Is your feature request related to a problem? Please describe.

I happen to come across a peculiar situation where it made sense to leverage the "--type-mapping" feature as the requirement had external model dependencies. However it seems that this feature is non-compliant with standard OpenAPI spec

for example:
I pass typeMappings.set([ 'refType': 'com.package' ]) and then in spec.yml I would simply say type: refType

If I were to run this spec for creating swagger-ui it would cause an error like "undefined type".

Lucky for us spring-doc auto-config scans packages and generates swagger on the fly without the need to refer to the actual spec.yml

The caveat is that the generator doesn't map all essential sections of OpenAPI (i.e. info, tags, servers etc) to the camel REST-DSL. Which causes inconsistencies on swagger-ui.

Describe the solution you'd like

Update the java-camel generator to map essential sections of OpenAPI (i.e. info, tags, servers etc) to the camel REST-DSL if they're present.

OR

Provide a convenient way for the developer to configure these sections

Describe alternatives you've considered

Abstained from using "typeMapping" and reverted to traditional $ref

Additional context

  • It would enable flexible usage of generator specific features like typeMapping, schemaMapping without impacting swagger-ui concerns
  • This feature would improve swagger documentation with REST-DSL coming from the generator

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the java-camel generator and inspect how the OpenAPI document is translated into Camel REST-DSL. Compare handling of info, tags, and servers with the generated Swagger UI behavior. Done means present sections are mapped, or a documented configuration path exists, without typeMapping or schemaMapping reducing Swagger compatibility.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api, backend-api-design, documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.