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

Referencing self:: constants in annotations #269

Open
tbmatuka opened this issue Apr 21, 2019 · 5 comments
Open

Referencing self:: constants in annotations #269

tbmatuka opened this issue Apr 21, 2019 · 5 comments

Comments

@tbmatuka
Copy link

At the moment constant parsing doesn't read self:: constants and I have a use case where that would be the most practical solution:
I would like to pass serialization groups for a property that's defined in a trait. Since not all entities will have the same serialization groups for the properties in the traits, the only currently available options that I see is to either repeat the property definition in each entity or repeat the groups serialization definition for each property and each entity in yaml/xml.

I would have created a PR instead of an issue for this, but from what I see in the DocParser class, the only way to get the original class name would be to parse the context string, which seems like a bad idea. I'm hoping that someone more familiar with the codebase could do it in a cleaner way. If there isn't a better way, please let me know and I'll make a PR.

@jwage
Copy link
Member

jwage commented Apr 22, 2019

I think this most likely will have to wait for Annotations 2.0. Unfortunately the timeline for 2.0 is not solidified.

@tbmatuka
Copy link
Author

With @Majkl578 no longer working on 2.0, I don't think waiting for 2.0 to add new non BC breaking features makes sense. I don't mind doing the work, I just need a nudge in the right direction, if there is one. If not, I can add this feature the ugly way and it can be re-implemented properly in 2.0.

@tbmatuka
Copy link
Author

tbmatuka commented Nov 5, 2019

@alcaeus it looks like you took over the project, can you please weigh in on this issue?

@citizen63000
Copy link

citizen63000 commented Aug 8, 2020

At the moment constant parsing doesn't read self:: constants and I have a use case where that would be the most practical solution:
I would like to pass serialization groups for a property that's defined in a trait. Since not all entities will have the same serialization groups for the properties in the traits, the only currently available options that I see is to either repeat the property definition in each entity or repeat the groups serialization definition for each property and each entity in yaml/xml.

I would have created a PR instead of an issue for this, but from what I see in the DocParser class, the only way to get the original class name would be to parse the context string, which seems like a bad idea. I'm hoping that someone more familiar with the codebase could do it in a cleaner way. If there isn't a better way, please let me know and I'll make a PR.

+1 : this modification would be really great! The "static::" keyword too.

bertrandseurot added a commit to bertrandseurot/annotations that referenced this issue Oct 2, 2020
bertrandseurot added a commit to bertrandseurot/annotations that referenced this issue Oct 2, 2020
bertrandseurot added a commit to bertrandseurot/annotations that referenced this issue Oct 2, 2020
bertrandseurot added a commit to bertrandseurot/annotations that referenced this issue Oct 2, 2020
bertrandseurot added a commit to bertrandseurot/annotations that referenced this issue Oct 2, 2020
bertrandseurot added a commit to bertrandseurot/annotations that referenced this issue Oct 2, 2020
bertrandseurot added a commit to bertrandseurot/annotations that referenced this issue Oct 2, 2020
bertrandseurot added a commit to bertrandseurot/annotations that referenced this issue Oct 2, 2020
@guilliamxavier
Copy link

This has been released in 1.11.0, right?

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

4 participants