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

generated content of parameter comments for oneOfType is confusing #2990

Closed
CNFeffery opened this issue Sep 9, 2024 · 3 comments · Fixed by #2994
Closed

generated content of parameter comments for oneOfType is confusing #2990

CNFeffery opened this issue Sep 9, 2024 · 3 comments · Fixed by #2994
Labels
bug something broken P3 backlog

Comments

@CNFeffery
Copy link
Contributor

dash                 2.17.1
dash-core-components 2.0.0
dash-html-components 2.0.0
dash-table           5.0.0

The format of the component parameter documentation is confusing for complex parameters with the type format set to oneOfType, for example:

image

Generate documentation result, The order and structure from the source code are lost:

image

I hope to generate parameter documentation that is consistent with the order and structure in the source code.

@T4rk1n
Copy link
Contributor

T4rk1n commented Sep 9, 2024

I think this is sorted here:

for prop_name, prop in sorted(list(type_object["value"].items()))

Code probably predates default ordered dict, so the keys were sorted to have a consistent output. Should be removed and keep the order it was defined in the metadata.json

@gvwilson gvwilson changed the title [BUG] The generated content of parameter comments for oneOfType is confusing generated content of parameter comments for oneOfType is confusing Sep 9, 2024
@gvwilson gvwilson added bug something broken P3 backlog labels Sep 9, 2024
@CNFeffery
Copy link
Contributor Author

@T4rk1n I noticed that the dash-generate-components cli has a parameter named --keep-prop-order.
image

should the code below follow this parameter to change?

for prop_name, prop in sorted(list(type_object["value"].items()))

image

@T4rk1n
Copy link
Contributor

T4rk1n commented Sep 10, 2024

should the code below follow this parameter to change?

No I don't think it should follow that variable is for the main props but the bug here is with the shapes, I think just removing sorted(list( part would be enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P3 backlog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants