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

Change context to RequestScoped #993

Open
jota-coelho opened this issue Feb 17, 2025 · 4 comments
Open

Change context to RequestScoped #993

jota-coelho opened this issue Feb 17, 2025 · 4 comments
Labels
area:client This item is related to the client extension area:server This item is related to the server extension

Comments

@jota-coelho
Copy link

Is it possible to remove @jakarta.enterprise.context.ApplicationScoped from the generated class?
Both on the client and server sides. I need the classes to be @RequestScoped instead.

@ricardozanini
Copy link
Member

Hmm it's if we implement such a feature so one can opt-in to @RequestScoped instead:

  1. Add a new build-time, codegen property to use request scoped
  2. Read this property in the template file and add a conditional there

Application scope should be the default one. Feel free to send a PR.

@gastaldi
Copy link
Member

gastaldi commented Feb 18, 2025

What about generating with @Dependent? Then the scope is bound to the bean injecting it?

@ricardozanini ricardozanini added area:server This item is related to the server extension area:client This item is related to the client extension labels Feb 19, 2025
@ricardozanini
Copy link
Member

What about generating with @Dependent? Then the scope is bound to the bean injecting it?

+1

@mcruzdev
Copy link
Member

To solve it from server side we need to change the apicurio-codegen project. I created an issue Apicurio/apicurio-codegen#310

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:client This item is related to the client extension area:server This item is related to the server extension
Projects
None yet
Development

No branches or pull requests

4 participants