More complete OpenAPI 3.1 support in zod-openapi.#173
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 89578a7. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 2 targetsSent with 💌 from NxCloud. |
|
@A5rocks Can you resolve the conflicts here? |
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 6fdba79. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 2 targetsSent with 💌 from NxCloud. |
|
Alright, conflicts should now be fixed! |
| const schemaObjectWithRequiredField = { | ||
| const schemaObjectWithFixedFields = { | ||
| ...schemaObject, | ||
| type: schemaObject.type ? schemaObject.type[0] : schemaObject.type, |
There was a problem hiding this comment.
We should remove 'null' from type array then. Besides, this doesn't work with string values (rather than arrays) which TypeScript allows here. See #182.
There was a problem hiding this comment.
I think my changes make this work, but there's a case (or two) which I'm not sure about: type: [] or type: ["null"]. What do you think should happen then?
As of latest commit those should lead to undefined type which is... Idk, should this error instead?
|
hey there! @Brian-McBride / @erkstruwe , this looks rather ready and exactly what our team is looking for. Any chance this could be merged & released? We would love the 3.1 support to reference other Zod schemas, like generated Zod enums coming from https://www.npmjs.com/package/ts-to-zod , in manually created schemas. That currently doesn't work due to the missing $ref/3.1 support, but would greatly improve the output of the DTOs |
|
Up, anything we can do to get this pushed out? |
|
@lewinskimaciej Probably resolve merge conflicts? |
|
Yes, please resolve then the CI/CD can deploy. |
|
Hmm, CI failure doesn't look like my fault. Tests seem to pass, at least. |
There is one failing: https://github.com/anatine/zod-plugins/actions/runs/8350755969/job/22857844183?pr=173#step:7:96 |
|
Oops, I didn't notice that! Thought the red highlighted line was during setup so only looked after that... |
|
I think repo owners or maintainers have to configure problem-matchers for this github action to highlight failed test cases |
|
Yay! 🎉 |
|
Nice, thank you guys! ❤️ |
Split off from #130.