Skip to content
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

Allow configuration of annotation processing #8

Closed
arthurdm opened this issue Oct 18, 2017 · 9 comments
Closed

Allow configuration of annotation processing #8

arthurdm opened this issue Oct 18, 2017 · 9 comments
Labels

Comments

@arthurdm
Copy link
Member

arthurdm commented Oct 18, 2017

We should allow the configuration of annotation processing via MP Config, for example, which packages to scan (improves performance for large apps).

For example, a dev should be able to do this inside META-INF/microprofile-config.properties

openapi.packagesToScan=abc,def,
openapi.server=myhost:8443
...
openapi.filter=mypackage.myFilter  

The implementation of this spec would get those values injected (or can manually query for them).

mrglavas pushed a commit to mrglavas/microprofile-open-api that referenced this issue Oct 23, 2017
@arthurdm arthurdm added the design label Nov 9, 2017
@leochr
Copy link
Contributor

leochr commented Nov 13, 2017

openapi.classesToScan
A comma seperated list of classes to scan.
defaultValue = all
Example:
openapi.classesToScan=myPackages.PackageA.MyClassA,myPackages.PackageA.MyClassB

openapi.packagesToScan
List of packages to scan. Only classes from the list of packages will be scanned, others will not be scanned.
defaultValue = all
Example:
openapi.packagesToScan=myPackages.PackageA,myPackages.PackageB

openapi.disableScan
Control whether scanning should be done. By default scanning is turned on.
defaultValue = false
Example:
openapi.disableScan=true

openapi.filter
Full name of a class that implements the OASFilter interface. The methods from this class will be invoked before, during or after the scan.
defaultValue = NONE
Example:
openapi.filter=mypackage.myFilter

openapi.servers
List of global servers, which provide connectivity information.
defaultValue = /
Example:
openapi.servers=https://myserverA.com/v1,https://myserverB.com/v1

@leochr
Copy link
Contributor

leochr commented Nov 13, 2017

Servers for Paths

openapi.servers.path
An alternative list of servers to service all operations in this path.
Example:
openapi.servers.path./pet/name/{id}=https://myserverC.com/v1,https://myserverD.com/v1

@leochr
Copy link
Contributor

leochr commented Nov 13, 2017

Servers for Operations

openapi.servers.operation
An alternative list of servers to service this operation.
Example:
openapi.servers.operation.myOperationId=https://myserverE.com/v1

We can also use the way the operationRef references operation.This way operationId is not mandatory to specify alternate server for an operation.
openapi.servers.operation.#/paths/~1repositories~1{username}/get=https://myserverE.com/v1

@pilhuhn
Copy link

pilhuhn commented Nov 13, 2017

The config keys should have a "microprofile" prefix. We discussed that for the REST-client. @johnament probably recalls where :)

@arthurdm
Copy link
Member Author

One consideration may be to have these as public static final keys in some interface, so that vendors don't have to hardcode them or create their own static keys.

@arthurdm
Copy link
Member Author

@pilhuhn - should the prefix be simply mp to make it shorter / easier to write?

@pilhuhn
Copy link

pilhuhn commented Nov 16, 2017

Perfectly fine with me :-) I think it should be consistent with other specs.
I have created a thread in the Google group at https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/microprofile/LujyD0OYrP0

@leochr
Copy link
Contributor

leochr commented Nov 22, 2017

Latest list of configurable properties:

  • mp.openapi.model.reader
    Configuration property to specify the fully qualified name of the OASModelReader implementation.

  • mp.openapi.filter
    Configuration property to specify the fully qualified name of the OASFilter implementation.

  • mp.openapi.scan.disable
    Configuration property to disable annotation scanning.

  • mp.openapi.scan.packages
    Configuration property to specify the list of packages to scan.

  • mp.openapi.scan.classes
    Configuration property to specify the list of classes to scan.

  • mp.openapi.servers
    Configuration property to specify the list of global servers that provide connectivity information.

  • mp.openapi.servers.path.
    Prefix of the configuration property to specify an alternative list of servers to service all operations in a path.

  • mp.openapi.servers.operation.
    Prefix of the configuration property to specify an alternative list of servers to service an operation.

  • mp.openapi.extensions.
    Recommended prefix for vendor specific configuration properties.

@arthurdm
Copy link
Member Author

Thanks for the contribution! Closing this as merge #48 is in.

Azquelt pushed a commit to Azquelt/microprofile-open-api that referenced this issue Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants