cyprieng / swagger-parser

Give useful informations about your swagger files
MIT License
62 stars 59 forks source link

not validating properties #55

Open markfink opened 7 years ago

markfink commented 7 years ago

relevant part of the spec:

   properties:
      ...
      artifactBucket:
        type: string
        minLength: 5
        pattern: "arn:aws:([a-zA-Z0-9-])+:([a-z]{2}-[a-z]+-d{1})?:(d{12})?:(.*)"
        example: bla

this is how I use validate_request:

my_config = {
    "stack": {
        "StackName": "infra-dev-kumo-sample-stack",
        "RoleARN": "arn:aws:iam::<AccountID>:role/<CloudFormationRoleName>",
        "artifactBucket": "bla",
        "NotificationARNs": [
            "arn:aws:sns:eu-west-1:123456789012:mytopic2"
        ]
    }
}

print(parser.validate_request('/kumo', 'get', body=my_config))

if I run this I get:

$ python config_validate_kumo.py
True

I would expect False with an error message that explains the problem with artifactBucket.

cyprieng commented 7 years ago

Indeed, minLength and pattern are not supported yet