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

fix(jsonapi): fixed definition name to allow using the same class names in different namespaces #6676

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

nightio
Copy link
Contributor

@nightio nightio commented Sep 26, 2024

Q A
Branch? 3.3
Tickets -
License MIT
Doc PR -

It fixes documentation models reference in the case where there are 2 or more classes with the same name but in different namespaces.
Previously the very first class model was created and used in all places in documentation.

Now if the name is the same but namespace is different, a previous one element of a namespace is prepended to the name until the name is unique

@nightio
Copy link
Contributor Author

nightio commented Sep 26, 2024

@dunglas @soyuka Could you look at that?

@soyuka
Copy link
Member

soyuka commented Sep 27, 2024

just as #6485 and #6478 I'm afraid that changing json schema names may break stuff, therefore this needs a little bit more investigation and I don't have much time right now. I'm adding this to the list of enhancements for the next minor version as I really want to tackle the issue.

@nightio
Copy link
Contributor Author

nightio commented Sep 27, 2024

@soyuka it should not break anything - please look at the tests. The original cases are untouched.

If there are no 2 or more classes with the same name the output is identical.
In case more than one class has the same name just a new definition is added with part of the namespace, the first one looks exactly the same as in the previous implementation.

But it fixes the bug where documentation is generated in a wrong way.

@soyuka soyuka merged commit 4c58b33 into api-platform:3.3 Oct 1, 2024
76 of 154 checks passed
@soyuka
Copy link
Member

soyuka commented Oct 1, 2024

Thanks @nightio !

@nightio nightio deleted the fix_json_schema_definition_name branch October 14, 2024 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants