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

encoding/openapi: full support for OpenAPI #3133

Open
jpluscplusm opened this issue May 8, 2024 · 0 comments
Open

encoding/openapi: full support for OpenAPI #3133

jpluscplusm opened this issue May 8, 2024 · 0 comments
Labels
encoding FeatureRequest New feature or request

Comments

@jpluscplusm
Copy link
Collaborator

jpluscplusm commented May 8, 2024

Is your feature request related to a problem? Please describe.

Users with existing OpenAPI documents can use the OpenAPI support initially tracked in #56 to work with their documents using the cue command, and the Go API.

However, as issues such as #1501 and #386 point out, users can't currently take an arbitrary OpenAPI document, cue import it, and then cue export their way back to the original document. Various fixed fields mentioned at https://swagger.io/specification/#fixed-fields (such as paths, externalDocs, and several keys under components) are currently ignored when CUE imports an OpenAPI document.

Describe the solution you'd like

I'd like CUE to implement full round-trip-ability from OpenAPI to CUE and back again; or to document those OpenAPI features/fields/elements for which round-tripping is unlikely to be achieved, so that OpenAPI users can make judgements about the degree of support that they require, based on their specific, individual OpenAPI use.

(Note that this doesn't ask for full round-trip-ability from arbitrary CUE to OpenAPI and back again)

Describe alternatives you've considered

n/a.

Additional context

This is being opened as part of the documentation work being performed in https://cuelang.org/cl/1192024.

@jpluscplusm jpluscplusm added FeatureRequest New feature or request Triage Requires triage/attention encoding labels May 8, 2024
cueckoo pushed a commit to cue-lang/cuelang.org that referenced this issue May 8, 2024
This adds a concept guide demonstrating how CUE works with OpenAPI.

Much of the comparative discussion from
https://cuelang.org/docs/concept/schema-definition-use-case/#json-schema--openapi
is omitted, keeping the document focused on the pragmatic and possible.

cue-lang/cue#3133 was opened as part of this change, which asks the
project to support full round-tripping from OpenAPI to CUE and back
again; or to decide and document which OpenAPI elements aren't
supported.

For cue-lang/docs-and-content#72

Preview-Path: /docs/concept/how-cue-works-with-openapi/
Signed-off-by: Jonathan Matthews <github@hello.jonathanmatthews.com>
Change-Id: I9f9968d381d516f0e189616871919ddb063f11d3
cueckoo pushed a commit to cue-lang/cuelang.org-trybot that referenced this issue May 8, 2024
This adds a concept guide demonstrating how CUE works with OpenAPI.

Much of the comparative discussion from
https://cuelang.org/docs/concept/schema-definition-use-case/#json-schema--openapi
is omitted, keeping the document focused on the pragmatic and possible.

cue-lang/cue#3133 was opened as part of this change, which asks the
project to support full round-tripping from OpenAPI to CUE and back
again; or to decide and document which OpenAPI elements aren't
supported.

For cue-lang/docs-and-content#72

Preview-Path: /docs/concept/how-cue-works-with-openapi/
Signed-off-by: Jonathan Matthews <github@hello.jonathanmatthews.com>
Change-Id: I9f9968d381d516f0e189616871919ddb063f11d3
Dispatch-Trailer: {"type":"trybot","CL":1192024,"patchset":6,"ref":"refs/changes/24/1192024/6","targetBranch":"master"}
cueckoo pushed a commit to cue-lang/cuelang.org that referenced this issue May 9, 2024
This adds a concept guide demonstrating how CUE works with OpenAPI.

Much of the comparative discussion from
https://cuelang.org/docs/concept/schema-definition-use-case/#json-schema--openapi
is omitted, keeping the document focused on the pragmatic and possible.

cue-lang/cue#3133 was opened as part of this change, which asks the
project to support full round-tripping from OpenAPI to CUE and back
again; or to decide and document which OpenAPI elements aren't
supported.

For cue-lang/docs-and-content#72

Preview-Path: /docs/concept/how-cue-works-with-openapi/
Signed-off-by: Jonathan Matthews <github@hello.jonathanmatthews.com>
Change-Id: I9f9968d381d516f0e189616871919ddb063f11d3
cueckoo pushed a commit to cue-lang/cuelang.org-trybot that referenced this issue May 9, 2024
This adds a concept guide demonstrating how CUE works with OpenAPI.

Much of the comparative discussion from
https://cuelang.org/docs/concept/schema-definition-use-case/#json-schema--openapi
is omitted, keeping the document focused on the pragmatic and possible.

cue-lang/cue#3133 was opened as part of this change, which asks the
project to support full round-tripping from OpenAPI to CUE and back
again; or to decide and document which OpenAPI elements aren't
supported.

For cue-lang/docs-and-content#72

Preview-Path: /docs/concept/how-cue-works-with-openapi/
Signed-off-by: Jonathan Matthews <github@hello.jonathanmatthews.com>
Change-Id: I9f9968d381d516f0e189616871919ddb063f11d3
Dispatch-Trailer: {"type":"trybot","CL":1192024,"patchset":7,"ref":"refs/changes/24/1192024/7","targetBranch":"master"}
cueckoo pushed a commit to cue-lang/cuelang.org that referenced this issue May 9, 2024
This adds a concept guide demonstrating how CUE works with OpenAPI.

Much of the comparative discussion from
https://cuelang.org/docs/concept/schema-definition-use-case/#json-schema--openapi
is omitted, keeping the document focused on the pragmatic and possible.

cue-lang/cue#3133 was opened as part of this change, which asks the
project to support full round-tripping from OpenAPI to CUE and back
again; or to decide and document which OpenAPI elements aren't
supported.

For cue-lang/docs-and-content#72

Preview-Path: /docs/concept/how-cue-works-with-openapi/
Signed-off-by: Jonathan Matthews <github@hello.jonathanmatthews.com>
Change-Id: I9f9968d381d516f0e189616871919ddb063f11d3
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1192024
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Paul Jolly <paul@myitcv.io>
@myitcv myitcv changed the title encoding/openapi: full round-trip capability from OpenAPI to CUE and back to OpenAPI encoding/openapi: full support for OpenAPI May 9, 2024
@myitcv myitcv removed the Triage Requires triage/attention label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
encoding FeatureRequest New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants