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

Restrict which types can have minimum and maximum values #685

Open
gheine opened this issue Sep 6, 2017 · 0 comments
Open

Restrict which types can have minimum and maximum values #685

gheine opened this issue Sep 6, 2017 · 0 comments
Labels

Comments

@gheine
Copy link
Contributor

gheine commented Sep 6, 2017

Currently, minimum and maximum values can be applied all types, when they really only make sense for integer types (integer, long) and sequences (string, list).

Example:

  "name": "test",
  "base_url": "http://localhost.com",
  "apidoc": {
    "version": "0.11.48"
  },
  "models": {
    "foo": {
      "fields": [
        { 
          "name": "id",
          "type": "boolean"
        }
      ]
    },
    "test": {
      "fields": [
        {
          "name": "id",
          "type": "foo",
          "minimum": 0,
          "maximum": 10
        }
      ]
    }
  },
  "resources": {
    "test": {
      "operations": [
        {
          "method": "GET",
          "path": "/foo",
          "parameters": [
            {
              "name": "some_id",
              "type": "boolean",
              "location": "query",
              "minimum": 0,
              "maximum": 10
            }
          ],
          "responses": {
            "204": { "type": "unit" }
          }
        }
      ]
    }
  }
}
@gheine gheine added the spree label Sep 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant