Closed alapierre closed 3 weeks ago
Could you give an example of what the spec file should look like and what should be generated.
Also, judging by the feature description:
implicitHeaders | Skip header parameters in the generated API methods using @ApiImplicitParams annotation.
implicitHeadersRegex | Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true
The default generator adds swagger1 annotations, but we don't support swagger1. So what do we want to see with this feature? Just remove all headers from controller methods or regex headers?
Anyway, I figured it out myself. I'll add this.
it will be nice if we can provide any openApi configuration property eg. in this way: micronaut.openapi.configuration.implicitHeaders=true
- similar like in openapi-maven-plugin
I will add the ability to set these settings using the plugin for gradle and maven from micronaut
about other properties: I add them as requests come. It's not that fast to add absolutely everything, because we have 2 generators for Java and Kotlin and there's no point in wasting time on something that no one needs. When people write that they need something additionally, I add it. For example, like you
I also agree that such functionality would be useful. We’ve been writing applications in Micronaut for some time now, after migrating from Spring, and I would add that in Spring, it worked like this: If we defined:
<implicitHeaders>true</implicitHeaders>
Then OpenAPI would generate the endpoint like this:
@Parameters({
@Parameter(name = "X-EXAMPLE-HEADER", description = "Example header", required = true, in = ParameterIn.HEADER)
})
ResponseEntity<Foo> testApi();
@karolbryzgiel I already fixed it here: https://github.com/micronaut-projects/micronaut-openapi/pull/1730, wait next release
Feature description
Sometimes it is convenient to skip some header parameters when Java code is generated form open api yaml file.
implicitHeadersRegex
andimplicitHeaders
params do the job for this case.