Skip to content

Commit

Permalink
Do not enforce minimum value of page_number at model level
Browse files Browse the repository at this point in the history
- This is to avoid spurious constraints being added to the OpenAPI
  schema
- Instead, validate the value on creation of overall QueryParameter
  model.
  • Loading branch information
ml-evs committed Oct 25, 2022
1 parent 324df95 commit aa3f0b3
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 93 deletions.
17 changes: 8 additions & 9 deletions openapi/index_openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@
"required": false,
"schema": {
"title": "Page Number",
"minimum": 1.0,
"type": "integer",
"description": "RECOMMENDED for use with _page-based_ pagination: using `page_number` and `page_limit` is RECOMMENDED.\nIt is RECOMMENDED that the first page has number 1, i.e., that `page_number` is 1-based.\nExample: Fetch page 2 of up to 50 structures per page: `/structures?page_number=2&page_limit=50`."
},
Expand Down Expand Up @@ -510,15 +509,15 @@
"title": "Id",
"type": "string",
"description": "An entry's ID as defined in section Definition of Terms.\n\n- **Type**: string.\n\n- **Requirements/Conventions**:\n - **Support**: MUST be supported by all implementations, MUST NOT be `null`.\n - **Query**: MUST be a queryable property with support for all mandatory filter features.\n - **Response**: REQUIRED in the response.\n\n- **Examples**:\n - `\"db/1234567\"`\n - `\"cod/2000000\"`\n - `\"cod/2000000@1234567\"`\n - `\"nomad/L1234567890\"`\n - `\"42\"`",
"x-optimade-support": "must",
"x-optimade-queryable": "must"
"x-optimade-queryable": "must",
"x-optimade-support": "must"
},
"type": {
"title": "Type",
"type": "string",
"description": "The name of the type of an entry.\n\n- **Type**: string.\n\n- **Requirements/Conventions**:\n - **Support**: MUST be supported by all implementations, MUST NOT be `null`.\n - **Query**: MUST be a queryable property with support for all mandatory filter features.\n - **Response**: REQUIRED in the response.\n - MUST be an existing entry type.\n - The entry of type `<type>` and ID `<id>` MUST be returned in response to a request for `/<type>/<id>` under the versioned base URL.\n\n- **Example**: `\"structures\"`",
"x-optimade-support": "must",
"x-optimade-queryable": "must"
"x-optimade-queryable": "must",
"x-optimade-support": "must"
},
"links": {
"title": "Links",
Expand Down Expand Up @@ -570,8 +569,8 @@
"title": "Immutable Id",
"type": "string",
"description": "The entry's immutable ID (e.g., an UUID). This is important for databases having preferred IDs that point to \"the latest version\" of a record, but still offer access to older variants. This ID maps to the version-specific record, in case it changes in the future.\n\n- **Type**: string.\n\n- **Requirements/Conventions**:\n - **Support**: OPTIONAL support in implementations, i.e., MAY be `null`.\n - **Query**: MUST be a queryable property with support for all mandatory filter features.\n\n- **Examples**:\n - `\"8bd3e750-b477-41a0-9b11-3a799f21b44f\"`\n - `\"fjeiwoj,54;@=%<>#32\"` (Strings that are not URL-safe are allowed.)",
"x-optimade-support": "optional",
"x-optimade-queryable": "must"
"x-optimade-queryable": "must",
"x-optimade-support": "optional"
},
"last_modified": {
"title": "Last Modified",
Expand Down Expand Up @@ -1119,8 +1118,8 @@
"title": "Id",
"type": "string",
"description": "An entry's ID as defined in section Definition of Terms.\n\n- **Type**: string.\n\n- **Requirements/Conventions**:\n - **Support**: MUST be supported by all implementations, MUST NOT be `null`.\n - **Query**: MUST be a queryable property with support for all mandatory filter features.\n - **Response**: REQUIRED in the response.\n\n- **Examples**:\n - `\"db/1234567\"`\n - `\"cod/2000000\"`\n - `\"cod/2000000@1234567\"`\n - `\"nomad/L1234567890\"`\n - `\"42\"`",
"x-optimade-support": "must",
"x-optimade-queryable": "must"
"x-optimade-queryable": "must",
"x-optimade-support": "must"
},
"type": {
"title": "Type",
Expand Down

0 comments on commit aa3f0b3

Please sign in to comment.