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

More than two annotation target path segments #254

Open
golchha007 opened this issue Jul 6, 2023 · 5 comments
Open

More than two annotation target path segments #254

golchha007 opened this issue Jul 6, 2023 · 5 comments
Labels

Comments

@golchha007
Copy link

Hello,

While converting odata v2 to open api spec we get "More than two annotation target path segments" warning message.
Looking at code base, we could figure out that currently more than 2 level of path for annotations is not supported.

Can you please help us know the reason behind why this scenario is not supported ?
Also please let us know if you had face any challenge incase you tried implementing it or if there is plan to support it in future.

Best Regards,
Gaurav

@ralfhandl
Copy link
Contributor

Hi Gaurav (@golchha007),

So far I was not aware of use cases needing more than one target path segments.

Could you please explain what you want to achieve, and provide an example (full EDMX or snippets) for your use case?

Thanks in advance

@golchha007
Copy link
Author

Hi Ralf,

Sharing a pdf file with Annotation whose target path is more than 2 level.
Annotation.pdf

The target path is "cds_xdmoxui_travel_approver_m.__Format/FitToPage/ErrorRecoveryBehavior".
If it would have been 2 level upto FitToPage it would be handled by the existing code base but for this scenario where we have 3 level target path segment, we end up getting warning message as "More than two annotation target path segments"

Best Regards,
Gaurav

@ralfhandl
Copy link
Contributor

Hi Gaurav,

Neither ValueListReferences nor ValueListWithFixedValues is used in OpenAPI generation, so they would be silently ignored anyway, see the list of Supported Annotations.

Now they are ignored "loudly" and OpenAPI generation should succeed.

Does this answer your question?

Thanks in advance
Ralf

@golchha007
Copy link
Author

Hi Ralf,

Thanks for clearing the doubt.
But this actually lead me to another doubt. Will annotation which is supported and has more than two annotation target path, will that be ignored with warning message "More than two annotation target path segments"
For example Immutable is a supported Annotation but has more than two annotation target path. What will happen in such case ?

Best Regards,
Gaurav

@ralfhandl
Copy link
Contributor

Hi Gaurav,

for Immutable you are effectively limited to one path segment only, target must use the pattern qualified.entitytype/property.

OData allows you to use two or more path segments to express for example "street within the shipping address of a sales quote is immutable, and in all other uses of address it is mutable", but the OpenAPI generator can't express this as it will generate a single schema for a complex type, and not different schemas for different uses of the complex type.

If you have more questions, please don't hesitate to ask.

Thanks in advance

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

2 participants