Skip to content

Commit

Permalink
Change default value to null
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Feb 27, 2023
1 parent d2fca40 commit fd64cfd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 26 deletions.
6 changes: 2 additions & 4 deletions openapi/index_openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,7 @@
"schema": {
"title": "Page Above",
"type": "string",
"description": "RECOMMENDED for use with _value-based_ pagination: using `page_above`/`page_below` and `page_limit` is RECOMMENDED.\nExample: Fetch up to 100 structures above sort-field value 4000 (in this example, server chooses to fetch results sorted by increasing `id`, so `page_above` value refers to an `id` value): `/structures?page_above=4000&page_limit=100`.",
"default": ""
"description": "RECOMMENDED for use with _value-based_ pagination: using `page_above`/`page_below` and `page_limit` is RECOMMENDED.\nExample: Fetch up to 100 structures above sort-field value 4000 (in this example, server chooses to fetch results sorted by increasing `id`, so `page_above` value refers to an `id` value): `/structures?page_above=4000&page_limit=100`."
},
"name": "page_above",
"in": "query"
Expand All @@ -236,8 +235,7 @@
"schema": {
"title": "Page Below",
"type": "string",
"description": "RECOMMENDED for use with _value-based_ pagination: using `page_above`/`page_below` and `page_limit` is RECOMMENDED.",
"default": ""
"description": "RECOMMENDED for use with _value-based_ pagination: using `page_above`/`page_below` and `page_limit` is RECOMMENDED."
},
"name": "page_below",
"in": "query"
Expand Down
34 changes: 14 additions & 20 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,7 @@
"schema": {
"title": "Page Above",
"type": "string",
"description": "RECOMMENDED for use with _value-based_ pagination: using `page_above`/`page_below` and `page_limit` is RECOMMENDED.\nExample: Fetch up to 100 structures above sort-field value 4000 (in this example, server chooses to fetch results sorted by increasing `id`, so `page_above` value refers to an `id` value): `/structures?page_above=4000&page_limit=100`.",
"default": ""
"description": "RECOMMENDED for use with _value-based_ pagination: using `page_above`/`page_below` and `page_limit` is RECOMMENDED.\nExample: Fetch up to 100 structures above sort-field value 4000 (in this example, server chooses to fetch results sorted by increasing `id`, so `page_above` value refers to an `id` value): `/structures?page_above=4000&page_limit=100`."
},
"name": "page_above",
"in": "query"
Expand All @@ -338,8 +337,7 @@
"schema": {
"title": "Page Below",
"type": "string",
"description": "RECOMMENDED for use with _value-based_ pagination: using `page_above`/`page_below` and `page_limit` is RECOMMENDED.",
"default": ""
"description": "RECOMMENDED for use with _value-based_ pagination: using `page_above`/`page_below` and `page_limit` is RECOMMENDED."
},
"name": "page_below",
"in": "query"
Expand Down Expand Up @@ -581,8 +579,7 @@
"schema": {
"title": "Page Above",
"type": "string",
"description": "RECOMMENDED for use with _value-based_ pagination: using `page_above`/`page_below` and `page_limit` is RECOMMENDED.\nExample: Fetch up to 100 structures above sort-field value 4000 (in this example, server chooses to fetch results sorted by increasing `id`, so `page_above` value refers to an `id` value): `/structures?page_above=4000&page_limit=100`.",
"default": ""
"description": "RECOMMENDED for use with _value-based_ pagination: using `page_above`/`page_below` and `page_limit` is RECOMMENDED.\nExample: Fetch up to 100 structures above sort-field value 4000 (in this example, server chooses to fetch results sorted by increasing `id`, so `page_above` value refers to an `id` value): `/structures?page_above=4000&page_limit=100`."
},
"name": "page_above",
"in": "query"
Expand All @@ -593,8 +590,7 @@
"schema": {
"title": "Page Below",
"type": "string",
"description": "RECOMMENDED for use with _value-based_ pagination: using `page_above`/`page_below` and `page_limit` is RECOMMENDED.",
"default": ""
"description": "RECOMMENDED for use with _value-based_ pagination: using `page_above`/`page_below` and `page_limit` is RECOMMENDED."
},
"name": "page_below",
"in": "query"
Expand Down Expand Up @@ -1001,8 +997,7 @@
"schema": {
"title": "Page Above",
"type": "string",
"description": "RECOMMENDED for use with _value-based_ pagination: using `page_above`/`page_below` and `page_limit` is RECOMMENDED.\nExample: Fetch up to 100 structures above sort-field value 4000 (in this example, server chooses to fetch results sorted by increasing `id`, so `page_above` value refers to an `id` value): `/structures?page_above=4000&page_limit=100`.",
"default": ""
"description": "RECOMMENDED for use with _value-based_ pagination: using `page_above`/`page_below` and `page_limit` is RECOMMENDED.\nExample: Fetch up to 100 structures above sort-field value 4000 (in this example, server chooses to fetch results sorted by increasing `id`, so `page_above` value refers to an `id` value): `/structures?page_above=4000&page_limit=100`."
},
"name": "page_above",
"in": "query"
Expand All @@ -1013,8 +1008,7 @@
"schema": {
"title": "Page Below",
"type": "string",
"description": "RECOMMENDED for use with _value-based_ pagination: using `page_above`/`page_below` and `page_limit` is RECOMMENDED.",
"default": ""
"description": "RECOMMENDED for use with _value-based_ pagination: using `page_above`/`page_below` and `page_limit` is RECOMMENDED."
},
"name": "page_below",
"in": "query"
Expand Down Expand Up @@ -2746,8 +2740,8 @@
"type": "string",
"description": "The URL of the reference.",
"format": "uri",
"x-optimade-queryable": "optional",
"x-optimade-support": "optional"
"x-optimade-support": "optional",
"x-optimade-queryable": "optional"
},
"address": {
"title": "Address",
Expand Down Expand Up @@ -3354,8 +3348,8 @@
},
"description": "If present MUST be a list of floats expressed in a.m.u.\nElements denoting vacancies MUST have masses equal to 0.",
"x-optimade-queryable": "optional",
"x-optimade-support": "optional",
"x-optimade-unit": "a.m.u."
"x-optimade-unit": "a.m.u.",
"x-optimade-support": "optional"
},
"original_name": {
"title": "Original Name",
Expand Down Expand Up @@ -3607,8 +3601,8 @@
},
"description": "List of three integers.\nFor each of the three directions indicated by the three lattice vectors (see property `lattice_vectors`), this list indicates if the direction is periodic (value `1`) or non-periodic (value `0`).\nNote: the elements in this list each refer to the direction of the corresponding entry in `lattice_vectors` and *not* the Cartesian x, y, z directions.\n\n- **Type**: list of integers.\n\n- **Requirements/Conventions**:\n - **Support**: SHOULD be supported by all implementations, i.e., SHOULD NOT be `null`.\n - **Query**: Support for queries on this property is OPTIONAL.\n - MUST be a list of length 3.\n - Each integer element MUST assume only the value 0 or 1.\n\n- **Examples**:\n - For a molecule: `[0, 0, 0]`\n - For a wire along the direction specified by the third lattice vector: `[0, 0, 1]`\n - For a 2D surface/slab, periodic on the plane defined by the first and third lattice vectors: `[1, 0, 1]`\n - For a bulk 3D system: `[1, 1, 1]`",
"nullable": true,
"x-optimade-queryable": "optional",
"x-optimade-support": "should"
"x-optimade-support": "should",
"x-optimade-queryable": "optional"
},
"nperiodic_dimensions": {
"title": "Nperiodic Dimensions",
Expand All @@ -3633,8 +3627,8 @@
},
"description": "The three lattice vectors in Cartesian coordinates, in \u00e5ngstr\u00f6m (\u00c5).\n\n- **Type**: list of list of floats or unknown values.\n\n- **Requirements/Conventions**:\n - **Support**: SHOULD be supported by all implementations, i.e., SHOULD NOT be `null`.\n - **Query**: Support for queries on this property is OPTIONAL.\n If supported, filters MAY support only a subset of comparison operators.\n - MUST be a list of three vectors *a*, *b*, and *c*, where each of the vectors MUST BE a list of the vector's coordinates along the x, y, and z Cartesian coordinates.\n (Therefore, the first index runs over the three lattice vectors and the second index runs over the x, y, z Cartesian coordinates).\n - For databases that do not define an absolute Cartesian system (e.g., only defining the length and angles between vectors), the first lattice vector SHOULD be set along *x* and the second on the *xy*-plane.\n - MUST always contain three vectors of three coordinates each, independently of the elements of property `dimension_types`.\n The vectors SHOULD by convention be chosen so the determinant of the `lattice_vectors` matrix is different from zero.\n The vectors in the non-periodic directions have no significance beyond fulfilling these requirements.\n - The coordinates of the lattice vectors of non-periodic dimensions (i.e., those dimensions for which `dimension_types` is `0`) MAY be given as a list of all `null` values.\n If a lattice vector contains the value `null`, all coordinates of that lattice vector MUST be `null`.\n\n- **Examples**:\n - `[[4.0,0.0,0.0],[0.0,4.0,0.0],[0.0,1.0,4.0]]` represents a cell, where the first vector is `(4, 0, 0)`, i.e., a vector aligned along the `x` axis of length 4 \u00c5; the second vector is `(0, 4, 0)`; and the third vector is `(0, 1, 4)`.",
"nullable": true,
"x-optimade-queryable": "optional",
"x-optimade-support": "should",
"x-optimade-queryable": "optional",
"x-optimade-unit": "\u00c5"
},
"cartesian_site_positions": {
Expand All @@ -3650,8 +3644,8 @@
},
"description": "Cartesian positions of each site in the structure.\nA site is usually used to describe positions of atoms; what atoms can be encountered at a given site is conveyed by the `species_at_sites` property, and the species themselves are described in the `species` property.\n\n- **Type**: list of list of floats\n\n- **Requirements/Conventions**:\n - **Support**: SHOULD be supported by all implementations, i.e., SHOULD NOT be `null`.\n - **Query**: Support for queries on this property is OPTIONAL.\n If supported, filters MAY support only a subset of comparison operators.\n - It MUST be a list of length equal to the number of sites in the structure, where every element is a list of the three Cartesian coordinates of a site expressed as float values in the unit angstrom (\u00c5).\n - An entry MAY have multiple sites at the same Cartesian position (for a relevant use of this, see e.g., the property `assemblies`).\n\n- **Examples**:\n - `[[0,0,0],[0,0,2]]` indicates a structure with two sites, one sitting at the origin and one along the (positive) *z*-axis, 2 \u00c5 away from the origin.",
"nullable": true,
"x-optimade-queryable": "optional",
"x-optimade-support": "should",
"x-optimade-queryable": "optional",
"x-optimade-unit": "\u00c5"
},
"nsites": {
Expand Down
4 changes: 2 additions & 2 deletions optimade/server/query_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,11 @@ def __init__(
ge=0,
),
page_above: str = Query(
"",
None,
description="RECOMMENDED for use with _value-based_ pagination: using `page_above`/`page_below` and `page_limit` is RECOMMENDED.\nExample: Fetch up to 100 structures above sort-field value 4000 (in this example, server chooses to fetch results sorted by increasing `id`, so `page_above` value refers to an `id` value): `/structures?page_above=4000&page_limit=100`.",
),
page_below: str = Query(
"",
None,
description="RECOMMENDED for use with _value-based_ pagination: using `page_above`/`page_below` and `page_limit` is RECOMMENDED.",
),
include: str = Query(
Expand Down

0 comments on commit fd64cfd

Please sign in to comment.