Skip to content

Schema for dict with custom schema type as value #1036

Answered by Peefy
eliasp asked this question in Q&A
Discussion options

You must be logged in to vote

The right code may be

schema Owner:
    displayname: str
    email: str

schema Owners:
    [str]: Owner

deploymentOwners = Owners {
    "jdoe" = {
        displayname = "John Doe"
        email = "john@doe.internal"
    }
    "msomebody" = {
        displayname = "Mike Somebody"
        email = "mike@corp.test"
    }
}

Replies: 2 comments 2 replies

Comment options

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

Answer selected by eliasp
Comment options

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants