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

doc-generator - profile mode Link properties include entire schema #447

Open
jautor opened this issue May 31, 2023 · 1 comment
Open

doc-generator - profile mode Link properties include entire schema #447

jautor opened this issue May 31, 2023 · 1 comment
Assignees

Comments

@jautor
Copy link
Member

jautor commented May 31, 2023

In profile mode (and this is unique to profile mode), a requirement placed on a Links property will render the entire schema of the link type, instead of just showing the @odata.id for that reference. This is caused by the default processing of JSON objects in profile mode. Since a link property is an object, it gets treated as such by the doc-generator. Since a link will have no PropertyRequirements for the embedded object, it is treated as any other JSON object with no further requirements specified in the profile - that is, an object with no requirements is treated as if all embedded properties are "Mandatory". This causes the doc-generator to therefore include the entire schema that is the target of the link.

@jautor
Copy link
Member Author

jautor commented May 31, 2023

Adding a PropertyRequirements section to a Link property to specify @odata.id as a mandatory property changes the output such that only the schema-required properties are listed (Id, 'Name, @odata.typeand@odata.id`).

This also only seems to apply to Links to schemas that are mentioned in the profile. Links to schema types with no requirements shown in the profile behave as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants