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

OASFactory.INSTANCE ignores the resolver set #80

Closed
johnament opened this issue Nov 29, 2017 · 3 comments
Closed

OASFactory.INSTANCE ignores the resolver set #80

johnament opened this issue Nov 29, 2017 · 3 comments

Comments

@johnament
Copy link

johnament commented Nov 29, 2017

If you set the resolver via OASFactoryResolver.setInstance, that resolver is not used by invocations to the factory. The value is set when the class is loaded.

Instead, you should just ask for the resolved instance on each invocation. I also wonder if this class should be an API, with methods defined, instead of being a static factory? Maybe a different issue.

@arthurdm
Copy link
Member

@leochr / @mrglavas - can you please take a look into this one?

@leochr
Copy link
Contributor

leochr commented Nov 29, 2017

The OASFactory follows the same static resolver pattern as of ConfigProvider from MP Config.

We also posted in the google forum about the static resolver pattern and were told that it's fine/reasonable to expect that there is only one implementation of resolver within a vendor's environment and it be set at the beginning (vendor's responsibility). OASFactoryResolver.setInstance is to be used by OSGi environment while service loader pattern is not supported. Vendor should set the factory resolver before the factory class is loaded.

@Emily-Jiang your thoughts about the static resolver?

We decided the OASFactory to be static so it's easy for end users to invoke the static createObject method. e.g. OASFactory.createObject(Info.class).title("Airlines")

@arthurdm
Copy link
Member

Solved by merge #85

Azquelt pushed a commit to Azquelt/microprofile-open-api that referenced this issue Mar 17, 2022
Bumps jandex from 2.1.0.Final to 2.1.1.Final.

Signed-off-by: dependabot[bot] <support@dependabot.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants