Repository navigation
Fix/pydantic nf validation errors - #2
Conversation
Mira PR WalkthroughThis PR fixes pydantic validation errors in the generated NF-e (notas fiscais) and NFC-e (notas fiscais consumidor) schemas by refining schema overrides in the code generator and updating the generated model files. It extends Confidence: 4/5 ◉◉◉◉○ Safe to merge
Key files to review:
16 files reviewed · 2 comments (💡 2 suggestions)
|
There was a problem hiding this comment.
Mira Review Summary
The review flags two gaps in scripts/generate_models.py. The main one, at line 332, is that the required-writeOnly detector only scans a schema's own top-level properties and required lists, so a writeOnly-required property introduced via inline allOf/items composition (with no $ref) is silently missed. Separately, the response projection at line 319 skips responses routed through components.requestBodies/responses.
Key Issues
| Issue | Location | |
|---|---|---|
| 🔴 | The required-writeOnly detector only scans a schema's own top-level properties/required; a writeOnly-required property introduced via inline allOf/items composition (no $ref) is silently missed, so the response projection would not relax it and generated response models would keep requiring the field — the same failure mode this PR fixes, without any test covering that shape. | scripts/generate_models.py:332 |
No description provided.