Hi all,
I have this piece of code in my application that exposes my api:
@ApplicationPath("my-rest")
@OpenAPIDefinition(
info = @Info(title = "MY REST API", description = "Some test API", version =
"1.0.0"),
security = @SecurityRequirement(name = "basicAuth")
)
@SecuritySchemes(value = {
@SecurityScheme(securitySchemeName = "basicAuth", type =
SecuritySchemeType.HTTP, scheme = "basic", description = "This resource needs
preemptive basic authentication"),
})
public class MyApplication extends Application {
}
My main goal is to be able to change the version-number from Maven.
I figured that I have two options:
*a)* Make the 'maven-war-plugin' do a substitute of a parameter-value that I
put in where "1.0.0" now is.
I could not figure out how to do this to the source-file before the compiler
had read the source and created the class-files
*b)* Removing the annotations @OpenAPIDefinition (...), and have it done from
code (ie. the constructor in the MyApplication-class)
I could not figure out which classes I needed to Inject or any other way I
could access the objects that is the result of the annotations.
Or my be I could keep the annotations, but overwrite the 'Info.version' with
some value from the constructor.
I would prefer to do the option b).
Could anyone give me some hints on how to do this?
Thank you in advance.
Regards, Erik
--
You received this message because you are subscribed to the Google Groups
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.