This repository has been archived by the owner on Nov 18, 2021. It is now read-only.
Replies: 2 comments
-
It is possible to generate CUE from JSON Schema, but OpenAPI to CUE or CUE to Go isn't there yet. In general, the individual translation adaptors have been implemented on a need-to-have basis. The JSON schema to CUE infrastructure could be reused to also support OpenAPI to CUE. |
Beta Was this translation helpful? Give feedback.
0 replies
-
This discussion has been migrated to cue-lang/cue#544. For more details about CUE's migration to a new home, please see cue-lang/cue#1078. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello
context
The source of truth in our company is JSON-API. It’s what we agree on when we implement something (endpoint (verb + path) but also input fields, data validation, description/explanation and possible errors)
When we all agree on this, we start by generating structs from the JSON-Schema part of the endpoint (input / output). We also run the validation based on a JSON-Schema library.
When we need to test our new endpoint, we generate an OpenAPI client from the OpenAPI file and test from it.
It has good advantages as we guarantee the doc is not an afterthought, we really think about what we implement/expose, we also better detect breaking changes when we do update (e.g if a PR changes some Input/output of existing tests done from the OpenAPI client).
Unfortunately the current process is far from perfect because:
question
Going back to clue, I understand it would be less powerful than using clue directly but I’m wondering if it was possible to generate cue files and Go structs starting from OpenAPI. I can only see examples the other way around.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions