Repository navigation
fix: prevent panic when parsing custom string types in OpenAPI v3 - #2115
Conversation
There was a problem hiding this comment.
The fix looks good! Adding nil checks for schema and schema.Spec before accessing Extensions prevents the panic.
One minor suggestion: It might be worth adding a unit test to cover this edge case (custom string types with form tags), to prevent regression in the future.
btw, just a small suggestion about the test - no big deal if you skip it
Thank you. I tried write unit test but it didn't catch this issue. I also had to use older version of v2 (the rc4) because todays v2 breaks other stuff in my generation 😀 That said, I will not add tests because it didn't work for me :/ |
Describe the PR
Prevent panic when parsing custom string types with form tags in OpenAPI v3
Relation issue
Fixing #2114 and probably #2078