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

Extend validation to validate multiple resources with the same schema #10

Closed
mcweba opened this issue Mar 10, 2016 · 2 comments
Closed

Comments

@mcweba
Copy link
Collaborator

mcweba commented Mar 10, 2016

Current validation feature

Let's say you have the following structure of resources and want to validate the res_1, res_2 and res_3 resource.
image
To validate these resources, you would have to deploy 3 different schemas and configure them in the validation resource like this:

{
  "resources": [
    {
      "url": "/playground/server/tests/resources/res_1",
      "method": "PUT"
    },
    {
      "url": "/playground/server/tests/resources/res_2",
      "method": "PUT"
    },
    {
      "url": "/playground/server/tests/resources/res_3",
      "method": "PUT"
    }    
  ]
}

Required additional validation functionality

So when res_1, res_2 and res_3 are instances of the same resource and therefore can be validated by the same schema, it would be useful to define one schema only.

It would be useful when the configuration could look something like this:

{
  "resources": [
    {
      "url": "/playground/server/tests/resources/.*",
      "method": "PUT"
    }    
  ]
}

This would mean that all resources under /playground/server/tests/resources/ will be validated. It has to be defined how the corresponding schema for this resources can be selected (maybe by defining the name of the schema as additional property in the validation resource).

@lbovet
Copy link
Member

lbovet commented Mar 10, 2016

Is it not already the case when using the _ placeholder in the schema path?

@mcweba
Copy link
Collaborator Author

mcweba commented Mar 10, 2016

You're absolutely right, using the underscore (_) in the schema path does the trick. Maybe the documentation is a little bit weak here 😉

@mcweba mcweba closed this as completed Mar 10, 2016
roggerj pushed a commit to roggerj/gateleen that referenced this issue Sep 6, 2017
hiddenalpha pushed a commit that referenced this issue Jul 8, 2021
Enable logging in test again to verify it really is running
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants