-
Notifications
You must be signed in to change notification settings - Fork 14
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
Avoid hardcoding Swagger information #56
Comments
@zregvart @EricWittmann does this request of modification make sense? is it a good idea to have it by default? |
from Bruno Meseguer:
but what is the configuration of apiContextPath that we should provide? There is already one provided in restConfiguration Line 21 in 3027c38
//cc @paoloantinori |
This was intentional, to serve the same OpenAPI document that the user provided. With the auto-generated document you loose some of the fidelity in the original OpenAPI document that was provided. Drawing in @chirino who requested this. |
Yeah the use-case here is presumably when doing design-first API development. I would think you'd want the original OpenAPI document to be served, since it will contain more information than can be generated automatically. I don't know Fuse well enough to say, but there may be some mismatch between the definition and what the generated code actually does. That can happen when e.g. generating a JAX-RS project. Still, serving the original definition is usually what is desired. |
Correct. The project was started design first, so we want to preserve as much info in the original as possible. It should be an intentional user action to convert to code first openapi doc generation. It might be a nice feature of the tooling to provide a way convert a project between the two approaches. |
from https://issues.jboss.org/browse/FUSETOOLS-3241
After creating an OpenApi definition with Apicurito, the use has the option to Generate a Fuse 7.1 Camel project based on the defined API.
The auto-generated Fuse project contains a REST DSL definition and uses the Maven dependency "camel-swagger-java-starter".
The skeleton created hardcodes the Swagger 2.0 information by loading the JSON definition in response to client requests. However the REST DSL is capable of auto-generating the Swagger information based on the REST DSL code. This allows dynamic Swagger documentation to be auto-generated when new REST operations are included in the DSL after the project has been created.
The following code is an extract from auto generating code from Apicurito:
The text was updated successfully, but these errors were encountered: