Refactor generated model files and enhance string handling - #65
Open
TimvdVooren wants to merge 7 commits into
Open
Refactor generated model files and enhance string handling#65TimvdVooren wants to merge 7 commits into
TimvdVooren wants to merge 7 commits into
Conversation
- Removed unused generated files for validation parameters and version model. - Updated library declarations for validation conditional query parameters and version model. - Improved string escaping logic in `stringCode` and `encodeWithRawKeys` functions to handle special characters and newlines correctly. - Added tests to verify string escaping functionality and ensure proper handling of raw strings.
Owner
|
AI? |
Author
|
Personally, I am not an AI sir 😄 But I did use AI for this fix, which might be why it raised your concern. |
Author
|
See my issue, for more info: |
…ntained Fix union
The union ...MapJsonConverter.toJson wrapped the payload as
{value: ..., runtimeType: ...}, which doesn't match the backend's
discriminated shape, so serialized union request bodies were rejected.
Emit the flat inner object instead (symmetric to the fromJson fix in #1),
returning {} for the null fallback.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…alization Fix union toJson to emit flat inner object
An inline oneOf/anyOf nested in an array response had no title of its own, so its union class was named after its discriminator keys (e.g. basic/video/timed -> BasicOrvideoOrtimedUnion). Two endpoints whose responses share discriminator values then collapse onto the same union class, binding it to the wrong variant types. Concretely, GET /quiz and GET /questions both use basic/video/timed, so getQuizzes was typed with the question union and crashed deserializing quiz payloads. Propagate the array's title onto an untitled oneOf/anyOf items schema, so the nested union inherits the array's (operation-level) title and gets a unique, per-operation name (e.g. "Response Get Quizzes" -> ResponseGetQuizzes), the same way a non-array oneOf response is already named from its own title. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Fix colliding union names for inline oneOf/anyOf inside arrays
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
stringCodeandencodeWithRawKeysfunctions to handle special characters and newlines correctly.