-
Notifications
You must be signed in to change notification settings - Fork 171
allow import declaration to load jsonschema #438
Comments
quick and dirty proof of concept: https://cue-review.googlesource.com/c/cue/+/6541 |
A few remarks:
|
Do you have a template for the project I could use?
Are you referring to https://github.com/cuelang/cue/blob/master/cmd/cue/cmd/import.go, I don't see much logic in there that's not specific to command line argument, are you suggestion that we generalize it so that the same parameters (interpretation/mode) can be passed in the import directive?
👍
Do you have more details on how root module relative imports work? I couldn't find them mentioned in https://cuelang.org/docs/concepts/packages/
I wonder if defining a package layout for jsonschema (and other foreign data) would make sense (similar to what's done w/ |
This issue has been migrated to cue-lang/cue#438. For more details about CUE's migration to a new home, please see cue-lang/cue#1078. |
Is your feature request related to a problem? Please describe.
Currently one has to rely on
cue import
to bulk convert JSON schema into CUE package in order to consume them from other.cue
files.Describe the solution you'd like
Instead it would be nice to be able to
import path/to/some.schema.json
.Describe alternatives you've considered
Using a dedicated
cue tool
(or maybecue.mod/gen
?) it ma ybe be possible convert JSON schema on the fly before importing them, but since the command line already support evaluation of JSON schema argument, it could make sense for cue to support native JSON schema import as well.Additional context
This might be beneficial for project relying on a large corpus of existing (or third-party) schemas, who wants to validate/transform/compose them using CUE without the overhead of maintaining a separate imported copy.
The text was updated successfully, but these errors were encountered: