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

Can't mix normal keys and regex keys? #72

Closed
jmacarthur opened this issue Oct 7, 2016 · 2 comments
Closed

Can't mix normal keys and regex keys? #72

jmacarthur opened this issue Oct 7, 2016 · 2 comments

Comments

@jmacarthur
Copy link
Contributor

I'd like to validate this data, which is part of the OpenControl project:

name:
  FRIST-800-53
AU-1:
  family: AU
  name: Audit and Accountability Policy and Procedures
AU-2:
  family: AU
  name: Audit Events
AU-2 (3):
  family: AU
  name: Audit Events | Reviews and Updates

If I try and use this schema:

type: map
mapping:
  name:
    type: str

  regex;/[A-Z]-/:
    type: map
    mapping:
      name:
        type: str
      family:
        type: str

Then it won't match, giving the error - Key 'name' does not match any regex '[A-Z]-'. Path: ''.: Path: '/'>. You can work around this by matching with regex;/^name$/:, but it's not clear in which order the regexes would be checked if several of them matched.

@jmacarthur
Copy link
Contributor Author

Raised pull request #73

@Grokzen
Copy link
Owner

Grokzen commented Nov 5, 2016

@jmacarthur Closing this because mentioned MR #73 was merged.

@Grokzen Grokzen closed this as completed Nov 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants