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

Update local OpenAPI schemes prior to copying #124

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions openapi/index_openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,14 @@
"Info"
],
"summary": "Get Info",
"operationId": "get_info_index_optimade_v0.10.0_info_get",
"operationId": "get_info_index_optimade_v0_10_0_info_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"title": "Response Get Info Index Optimade V0.10.0 Info Get",
"title": "Response Get Info Index Optimade V0 10 0 Info Get",
"anyOf": [
{
"$ref": "#/components/schemas/IndexInfoResponse"
Expand All @@ -230,7 +230,7 @@
"Links"
],
"summary": "Get Links",
"operationId": "get_links_index_optimade_v0.10.0_links_get",
"operationId": "get_links_index_optimade_v0_10_0_links_get",
"parameters": [
{
"description": "See [the full and latest OPTiMaDe spec](https://github.com/Materials-Consortia/OPTiMaDe/blob/develop/optimade.rst) for filter query syntax.\n\nExample: `chemical_formula = \"Al\" OR (prototype_formula = \"AB\" AND elements HAS Si, Al, O)`.\n",
Expand Down Expand Up @@ -358,7 +358,7 @@
"content": {
"application/json": {
"schema": {
"title": "Response Get Links Index Optimade V0.10.0 Links Get",
"title": "Response Get Links Index Optimade V0 10 0 Links Get",
"anyOf": [
{
"$ref": "#/components/schemas/LinksResponse"
Expand Down Expand Up @@ -390,14 +390,14 @@
"Info"
],
"summary": "Get Info",
"operationId": "get_info_index_optimade_v0.10_info_get",
"operationId": "get_info_index_optimade_v0_10_info_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"title": "Response Get Info Index Optimade V0.10 Info Get",
"title": "Response Get Info Index Optimade V0 10 Info Get",
"anyOf": [
{
"$ref": "#/components/schemas/IndexInfoResponse"
Expand All @@ -419,7 +419,7 @@
"Links"
],
"summary": "Get Links",
"operationId": "get_links_index_optimade_v0.10_links_get",
"operationId": "get_links_index_optimade_v0_10_links_get",
"parameters": [
{
"description": "See [the full and latest OPTiMaDe spec](https://github.com/Materials-Consortia/OPTiMaDe/blob/develop/optimade.rst) for filter query syntax.\n\nExample: `chemical_formula = \"Al\" OR (prototype_formula = \"AB\" AND elements HAS Si, Al, O)`.\n",
Expand Down Expand Up @@ -547,7 +547,7 @@
"content": {
"application/json": {
"schema": {
"title": "Response Get Links Index Optimade V0.10 Links Get",
"title": "Response Get Links Index Optimade V0 10 Links Get",
"anyOf": [
{
"$ref": "#/components/schemas/LinksResponse"
Expand Down
56 changes: 28 additions & 28 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -733,14 +733,14 @@
"Info"
],
"summary": "Get Info",
"operationId": "get_info_optimade_v0.10.0_info_get",
"operationId": "get_info_optimade_v0_10_0_info_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"title": "Response Get Info Optimade V0.10.0 Info Get",
"title": "Response Get Info Optimade V0 10 0 Info Get",
"anyOf": [
{
"$ref": "#/components/schemas/InfoResponse"
Expand All @@ -762,7 +762,7 @@
"Info"
],
"summary": "Get Entry Info",
"operationId": "get_entry_info_optimade_v0.10.0_info__entry__get",
"operationId": "get_entry_info_optimade_v0_10_0_info__entry__get",
"parameters": [
{
"required": true,
Expand All @@ -780,7 +780,7 @@
"content": {
"application/json": {
"schema": {
"title": "Response Get Entry Info Optimade V0.10.0 Info Entry Get",
"title": "Response Get Entry Info Optimade V0 10 0 Info Entry Get",
"anyOf": [
{
"$ref": "#/components/schemas/EntryInfoResponse"
Expand Down Expand Up @@ -812,7 +812,7 @@
"Links"
],
"summary": "Get Links",
"operationId": "get_links_optimade_v0.10.0_links_get",
"operationId": "get_links_optimade_v0_10_0_links_get",
"parameters": [
{
"description": "See [the full and latest OPTiMaDe spec](https://github.com/Materials-Consortia/OPTiMaDe/blob/develop/optimade.rst) for filter query syntax.\n\nExample: `chemical_formula = \"Al\" OR (prototype_formula = \"AB\" AND elements HAS Si, Al, O)`.\n",
Expand Down Expand Up @@ -940,7 +940,7 @@
"content": {
"application/json": {
"schema": {
"title": "Response Get Links Optimade V0.10.0 Links Get",
"title": "Response Get Links Optimade V0 10 0 Links Get",
"anyOf": [
{
"$ref": "#/components/schemas/LinksResponse"
Expand Down Expand Up @@ -972,7 +972,7 @@
"References"
],
"summary": "Get References",
"operationId": "get_references_optimade_v0.10.0_references_get",
"operationId": "get_references_optimade_v0_10_0_references_get",
"parameters": [
{
"description": "See [the full and latest OPTiMaDe spec](https://github.com/Materials-Consortia/OPTiMaDe/blob/develop/optimade.rst) for filter query syntax.\n\nExample: `chemical_formula = \"Al\" OR (prototype_formula = \"AB\" AND elements HAS Si, Al, O)`.\n",
Expand Down Expand Up @@ -1100,7 +1100,7 @@
"content": {
"application/json": {
"schema": {
"title": "Response Get References Optimade V0.10.0 References Get",
"title": "Response Get References Optimade V0 10 0 References Get",
"anyOf": [
{
"$ref": "#/components/schemas/ReferenceResponseMany"
Expand Down Expand Up @@ -1132,7 +1132,7 @@
"References"
],
"summary": "Get Single Reference",
"operationId": "get_single_reference_optimade_v0.10.0_references__entry_id__get",
"operationId": "get_single_reference_optimade_v0_10_0_references__entry_id__get",
"parameters": [
{
"required": true,
Expand Down Expand Up @@ -1181,7 +1181,7 @@
"content": {
"application/json": {
"schema": {
"title": "Response Get Single Reference Optimade V0.10.0 References Entry Id Get",
"title": "Response Get Single Reference Optimade V0 10 0 References Entry Id Get",
"anyOf": [
{
"$ref": "#/components/schemas/ReferenceResponseOne"
Expand Down Expand Up @@ -1213,7 +1213,7 @@
"Structures"
],
"summary": "Get Structures",
"operationId": "get_structures_optimade_v0.10.0_structures_get",
"operationId": "get_structures_optimade_v0_10_0_structures_get",
"parameters": [
{
"description": "See [the full and latest OPTiMaDe spec](https://github.com/Materials-Consortia/OPTiMaDe/blob/develop/optimade.rst) for filter query syntax.\n\nExample: `chemical_formula = \"Al\" OR (prototype_formula = \"AB\" AND elements HAS Si, Al, O)`.\n",
Expand Down Expand Up @@ -1341,7 +1341,7 @@
"content": {
"application/json": {
"schema": {
"title": "Response Get Structures Optimade V0.10.0 Structures Get",
"title": "Response Get Structures Optimade V0 10 0 Structures Get",
"anyOf": [
{
"$ref": "#/components/schemas/StructureResponseMany"
Expand Down Expand Up @@ -1373,7 +1373,7 @@
"Structures"
],
"summary": "Get Single Structure",
"operationId": "get_single_structure_optimade_v0.10.0_structures__entry_id__get",
"operationId": "get_single_structure_optimade_v0_10_0_structures__entry_id__get",
"parameters": [
{
"required": true,
Expand Down Expand Up @@ -1422,7 +1422,7 @@
"content": {
"application/json": {
"schema": {
"title": "Response Get Single Structure Optimade V0.10.0 Structures Entry Id Get",
"title": "Response Get Single Structure Optimade V0 10 0 Structures Entry Id Get",
"anyOf": [
{
"$ref": "#/components/schemas/StructureResponseOne"
Expand Down Expand Up @@ -1454,14 +1454,14 @@
"Info"
],
"summary": "Get Info",
"operationId": "get_info_optimade_v0.10_info_get",
"operationId": "get_info_optimade_v0_10_info_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"title": "Response Get Info Optimade V0.10 Info Get",
"title": "Response Get Info Optimade V0 10 Info Get",
"anyOf": [
{
"$ref": "#/components/schemas/InfoResponse"
Expand All @@ -1483,7 +1483,7 @@
"Info"
],
"summary": "Get Entry Info",
"operationId": "get_entry_info_optimade_v0.10_info__entry__get",
"operationId": "get_entry_info_optimade_v0_10_info__entry__get",
"parameters": [
{
"required": true,
Expand All @@ -1501,7 +1501,7 @@
"content": {
"application/json": {
"schema": {
"title": "Response Get Entry Info Optimade V0.10 Info Entry Get",
"title": "Response Get Entry Info Optimade V0 10 Info Entry Get",
"anyOf": [
{
"$ref": "#/components/schemas/EntryInfoResponse"
Expand Down Expand Up @@ -1533,7 +1533,7 @@
"Links"
],
"summary": "Get Links",
"operationId": "get_links_optimade_v0.10_links_get",
"operationId": "get_links_optimade_v0_10_links_get",
"parameters": [
{
"description": "See [the full and latest OPTiMaDe spec](https://github.com/Materials-Consortia/OPTiMaDe/blob/develop/optimade.rst) for filter query syntax.\n\nExample: `chemical_formula = \"Al\" OR (prototype_formula = \"AB\" AND elements HAS Si, Al, O)`.\n",
Expand Down Expand Up @@ -1661,7 +1661,7 @@
"content": {
"application/json": {
"schema": {
"title": "Response Get Links Optimade V0.10 Links Get",
"title": "Response Get Links Optimade V0 10 Links Get",
"anyOf": [
{
"$ref": "#/components/schemas/LinksResponse"
Expand Down Expand Up @@ -1693,7 +1693,7 @@
"References"
],
"summary": "Get References",
"operationId": "get_references_optimade_v0.10_references_get",
"operationId": "get_references_optimade_v0_10_references_get",
"parameters": [
{
"description": "See [the full and latest OPTiMaDe spec](https://github.com/Materials-Consortia/OPTiMaDe/blob/develop/optimade.rst) for filter query syntax.\n\nExample: `chemical_formula = \"Al\" OR (prototype_formula = \"AB\" AND elements HAS Si, Al, O)`.\n",
Expand Down Expand Up @@ -1821,7 +1821,7 @@
"content": {
"application/json": {
"schema": {
"title": "Response Get References Optimade V0.10 References Get",
"title": "Response Get References Optimade V0 10 References Get",
"anyOf": [
{
"$ref": "#/components/schemas/ReferenceResponseMany"
Expand Down Expand Up @@ -1853,7 +1853,7 @@
"References"
],
"summary": "Get Single Reference",
"operationId": "get_single_reference_optimade_v0.10_references__entry_id__get",
"operationId": "get_single_reference_optimade_v0_10_references__entry_id__get",
"parameters": [
{
"required": true,
Expand Down Expand Up @@ -1902,7 +1902,7 @@
"content": {
"application/json": {
"schema": {
"title": "Response Get Single Reference Optimade V0.10 References Entry Id Get",
"title": "Response Get Single Reference Optimade V0 10 References Entry Id Get",
"anyOf": [
{
"$ref": "#/components/schemas/ReferenceResponseOne"
Expand Down Expand Up @@ -1934,7 +1934,7 @@
"Structures"
],
"summary": "Get Structures",
"operationId": "get_structures_optimade_v0.10_structures_get",
"operationId": "get_structures_optimade_v0_10_structures_get",
"parameters": [
{
"description": "See [the full and latest OPTiMaDe spec](https://github.com/Materials-Consortia/OPTiMaDe/blob/develop/optimade.rst) for filter query syntax.\n\nExample: `chemical_formula = \"Al\" OR (prototype_formula = \"AB\" AND elements HAS Si, Al, O)`.\n",
Expand Down Expand Up @@ -2062,7 +2062,7 @@
"content": {
"application/json": {
"schema": {
"title": "Response Get Structures Optimade V0.10 Structures Get",
"title": "Response Get Structures Optimade V0 10 Structures Get",
"anyOf": [
{
"$ref": "#/components/schemas/StructureResponseMany"
Expand Down Expand Up @@ -2094,7 +2094,7 @@
"Structures"
],
"summary": "Get Single Structure",
"operationId": "get_single_structure_optimade_v0.10_structures__entry_id__get",
"operationId": "get_single_structure_optimade_v0_10_structures__entry_id__get",
"parameters": [
{
"required": true,
Expand Down Expand Up @@ -2143,7 +2143,7 @@
"content": {
"application/json": {
"schema": {
"title": "Response Get Single Structure Optimade V0.10 Structures Entry Id Get",
"title": "Response Get Single Structure Optimade V0 10 Structures Entry Id Get",
"anyOf": [
{
"$ref": "#/components/schemas/StructureResponseOne"
Expand Down
10 changes: 10 additions & 0 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ def setver(_, patch=False, new_ver=""):

@task
def update_openapijson(c):
# pylint: disable=import-outside-toplevel
from optimade.server.main import app, update_schema
from optimade.server.main_index import (
app as app_index,
update_schema as update_schema_index,
)

update_schema(app)
update_schema_index(app_index)

c.run("cp openapi/local_openapi.json openapi/openapi.json")
c.run("cp openapi/local_index_openapi.json openapi/index_openapi.json")

Expand Down