Skip to content
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

ttp 38 convert to openapi zod client typed openapi #3

Conversation

trevorpfiz
Copy link
Owner

  1. Canvas Postman Collection - https://www.postman.com/canvasmedical/workspace/canvas-medical-public-documentation
  2. postman2openapi - https://github.com/kevinswiber/postman2openapi
  3. typed-openapi - https://github.com/astahmer/typed-openapi
  4. Use generated client in tRPC routers and validate with z.parse()
  5. wow

Copy link

linear bot commented Nov 30, 2023

TTP-38 convert to openapi-zod-client / typed-openapi

astahmer/openapi-zod-client#246

astahmer/typed-openapi#18


Did it?

  1. Canvas Postman Collection - https://www.postman.com/canvasmedical/workspace/canvas-medical-public-documentation
  2. postman2openapi - https://github.com/kevinswiber/postman2openapi
  3. typed-openapi - https://github.com/astahmer/typed-openapi
  4. Use generated client in tRPC routers
  5. wow

Options:

  1. https://docs.canvasmedical.com/api/ -> https://transform.tools/json-to-zod -> z.deepPartial().parse()? (seems runtime checks not great)
  2. use openapi-typescript-codegen or orval (what will I do at runtime?)
  3. openapi-typescript -> ts-to-zod?
  4. fix errors so I can use openapi-zod-client
  5. try to convert their Postman collection into a better OpenAPI spec? https://www.postman.com/postman/workspace/postman-open-technologies-convert-postman-collections-into-openapi/overview

Incompatible types

  1. FHIRPrimitiveExtension
  2. Meta
  3. Resource
  4. BundleEntry
  5. BundleLink
  6. Identifier
  7. Signature
  8. searchset?
  9. Reference
  10. CodeableConcept
  11. Period
  12. Narrative
  13. Extension
  14. AllergyIntoleranceReaction
  15. Annotation
  16. ClaimRelated
  17. ClaimItem

Links:

https://x.com/nicu31/status/1724202849213485085?s=20

https://x.com/sirlonlilokli/status/1632094038751952898?s=20

@trevorpfiz trevorpfiz merged commit 7f3245b into main Nov 30, 2023
@trevorpfiz trevorpfiz deleted the elektrikspark/ttp-38-convert-to-openapi-zod-client-typed-openapi branch November 30, 2023 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant