Skip to content

Validating JSON encoded values #660

Answered by cueckoo
cueckoo asked this question in Q&A
Discussion options

You must be logged in to vote

Original reply by @mpvl in cuelang/cue#660 (comment)

import "encoding/json"

field1: json.Valid // is Valid JSON

field2: json.Validate(#Schema). // field must be valid JSON and conform to a given CUE schema

#Schema: { ... }

Replies: 1 comment 1 reply

Comment options

cueckoo
Jul 3, 2021
Collaborator Author

You must be logged in to vote
1 reply
@cueckoo
Comment options

cueckoo Jul 3, 2021
Collaborator Author

Answer selected by cueckoo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant