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
- Validate page number dynamically for database queries
- Add test for `page_number` validation
  • Loading branch information
ml-evs committed Oct 25, 2022
1 parent 01cb55d commit da90d4a
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 76 deletions.
5 changes: 2 additions & 3 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 @@ -578,8 +577,8 @@
"type": "string",
"description": "Date and time representing when the entry was last modified.\n\n- **Type**: timestamp.\n\n- **Requirements/Conventions**:\n - **Support**: SHOULD be supported by all implementations, i.e., SHOULD NOT be `null`.\n - **Query**: MUST be a queryable property with support for all mandatory filter features.\n - **Response**: REQUIRED in the response unless the query parameter `response_fields` is present and does not include this property.\n\n- **Example**:\n - As part of JSON response format: `\"2007-04-05T14:30:20Z\"` (i.e., encoded as an [RFC 3339 Internet Date/Time Format](https://tools.ietf.org/html/rfc3339#section-5.6) string.)",
"format": "date-time",
"x-optimade-queryable": "must",
"x-optimade-support": "should"
"x-optimade-support": "should",
"x-optimade-queryable": "must"
}
},
"description": "Contains key-value pairs representing the entry's properties."
Expand Down
Loading

0 comments on commit da90d4a

Please sign in to comment.