Skip to content

Is is safe to embed JSON in CUE? #20

@cueckoo

Description

@cueckoo

Originally opened by @enisoc in cuelang/cue#20

Since CUE is a superset of JSON, I understand that you can paste valid JSON into a .cue file and it will be guaranteed valid CUE as well.

My question is, is it guaranteed that valid JSON pasted into a .cue file will never accidentally invoke/trigger any features of CUE that are not in JSON?

For example, I'm guessing that string interpolation can't be triggered accidentally by valid JSON, since (I presume) the escape sequence \( is invalid JSON. Is CUE designed in such a way that all such features are systematically impossible to trigger from valid JSON?

In other words, is all valid JSON guaranteed to produce exactly the same output when treated as a CUE program? I haven't seen mention of this in the docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions