-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[FEATURE]: On Dart with Freezed, be able to prevent conflicts with nested types on JSON Schema #2660
Labels
Comments
5 tasks
polvallverdu
changed the title
[FEATURE]: feature description here
[FEATURE]: On Dart with Freezed, be able to prevent conflicts with nested types on JSON Schema
Oct 25, 2024
polvallverdu
added a commit
to wosherco/quicktype
that referenced
this issue
Nov 19, 2024
Fixes glideapps#2660 Modify the naming convention for nested objects in Dart Freezed class generation to include the parent object name. * **DartRenderer.ts** - Update `dartType` method to include the parent object name for nested objects. - Adjust `emitFreezedClassDefinition` and `emitClassDefinition` methods to handle the new naming convention for nested objects. - Modify `_emitVariables` method to use the new naming convention for nested objects. * **parser.dart** - Add tests for the new functionality to ensure nested objects include the parent object name. - Implement `testNestedObjectNaming` function to validate the new naming convention for nested objects. TODO: - [ ] Make sure tests work - [ ] Make sure this offers backwards compatibility --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/glideapps/quicktype/issues/2660?shareId=XXXX-XXXX-XXXX-XXXX).
I know the issue in your project and I will bring you good solutions if you can reach out me. |
Hello @polvallverdu I have fixed dart freezed issue in my local system |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context (Input, Language)
Input Format: Json Schema
Output Language: Dart Freezed
Description
Currently generating Freezed classes for Dart defines nested objects with their literal name, which may cause conflicts if multiple objects are needed. Some stuff is being done if it conflicts with it's own schema, but not for other schemas.
Current Behaviour / Output
Proposed Behaviour / Output
Solution
Somehow relate nested objects with their parents, to prevent conflicts.
Alternatives
Having the ability to control those names somehow, without needing interactivity. (kinda impossible)
The text was updated successfully, but these errors were encountered: