From e53a1cfa2a1497a0f00bec3b26d4408fc10be964 Mon Sep 17 00:00:00 2001 From: Noa Aviel Dove Date: Wed, 8 Jan 2025 14:07:42 -0800 Subject: [PATCH] [a] Fix: Untagged route in Swagger UI (#6791) --- lambdas/indexer/openapi.json | 7 +++++++ lambdas/service/app.py | 2 +- lambdas/service/openapi.json | 9 ++++++++- src/azul/chalice.py | 10 +++++++++- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/lambdas/indexer/openapi.json b/lambdas/indexer/openapi.json index 80ce3813b..8026bcc2f 100644 --- a/lambdas/indexer/openapi.json +++ b/lambdas/indexer/openapi.json @@ -40,7 +40,14 @@ }, "/static/swagger-initializer.js": { "get": { + "summary": "Used internally by the Swagger UI", + "tags": [ + "Auxiliary" + ], "responses": { + "200": { + "description": "The response body is JavaScript used internally by the Swagger UI" + }, "504": { "description": "\nRequest timed out. When handling this response, clients\nshould wait the number of seconds specified in the\n`Retry-After` header and then retry the request.\n" } diff --git a/lambdas/service/app.py b/lambdas/service/app.py index 0add4e1f8..8d56984ce 100644 --- a/lambdas/service/app.py +++ b/lambdas/service/app.py @@ -228,7 +228,7 @@ # changes and reset the minor version to zero. Otherwise, increment only # the minor version for backwards compatible changes. A backwards # compatible change is one that does not require updates to clients. - 'version': '10.0' + 'version': '10.1' }, 'tags': [ { diff --git a/lambdas/service/openapi.json b/lambdas/service/openapi.json index d40dfd3ca..90a765007 100644 --- a/lambdas/service/openapi.json +++ b/lambdas/service/openapi.json @@ -3,7 +3,7 @@ "info": { "title": "azul-service-dev", "description": "\n# Overview\n\nAzul is a REST web service for querying metadata associated with\nboth experimental and analysis data from a data repository. In order\nto deliver response times that make it suitable for interactive use\ncases, the set of metadata properties that it exposes for sorting,\nfiltering, and aggregation is limited. Azul provides a uniform view\nof the metadata over a range of diverse schemas, effectively\nshielding clients from changes in the schemas as they occur over\ntime. It does so, however, at the expense of detail in the set of\nmetadata properties it exposes and in the accuracy with which it\naggregates them.\n\nAzul denormalizes and aggregates metadata into several different\nindices for selected entity types. Metadata entities can be queried\nusing the [Index](#operations-tag-Index) endpoints.\n\nA set of indices forms a catalog. There is a default catalog called\n`dcp2` which will be used unless a\ndifferent catalog name is specified using the `catalog` query\nparameter. Metadata from different catalogs is completely\nindependent: a response obtained by querying one catalog does not\nnecessarily correlate to a response obtained by querying another\none. Two catalogs can contain metadata from the same sources or\ndifferent sources. It is only guaranteed that the body of a\nresponse by any given endpoint adheres to one schema,\nindependently of which catalog was specified in the request.\n\nAzul provides the ability to download data and metadata via the\n[Manifests](#operations-tag-Manifests) endpoints. The\n`curl` format manifests can be used to\ndownload data files. Other formats provide various views of the\nmetadata. Manifests can be generated for a selection of files using\nfilters. These filters are interchangeable with the filters used by\nthe [Index](#operations-tag-Index) endpoints.\n\nAzul also provides a [summary](#operations-Index-get_index_summary)\nview of indexed data.\n\n## Data model\n\nAny index, when queried, returns a JSON array of hits. Each hit\nrepresents a metadata entity. Nested in each hit is a summary of the\nproperties of entities associated with the hit. An entity is\nassociated either by a direct edge in the original metadata graph,\nor indirectly as a series of edges. The nested properties are\ngrouped by the type of the associated entity. The properties of all\ndata files associated with a particular sample, for example, are\nlisted under `hits[*].files` in a `/index/samples` response. It is\nimportant to note that while each _hit_ represents a discrete\nentity, the properties nested within that hit are the result of an\naggregation over potentially many associated entities.\n\nTo illustrate this, consider a data file that is part of two\nprojects (a project is a group of related experiments, typically by\none laboratory, institution or consortium). Querying the `files`\nindex for this file yields a hit looking something like:\n\n```\n{\n \"projects\": [\n {\n \"projectTitle\": \"Project One\"\n \"laboratory\": ...,\n ...\n },\n {\n \"projectTitle\": \"Project Two\"\n \"laboratory\": ...,\n ...\n }\n ],\n \"files\": [\n {\n \"format\": \"pdf\",\n \"name\": \"Team description.pdf\",\n ...\n }\n ]\n}\n```\n\nThis example hit contains two kinds of nested entities (a hit in an\nactual Azul response will contain more): There are the two projects\nentities, and the file itself. These nested entities contain\nselected metadata properties extracted in a consistent way. This\nmakes filtering and sorting simple.\n\nAlso notice that there is only one file. When querying a particular\nindex, the corresponding entity will always be a singleton like\nthis.\n", - "version": "10.0" + "version": "10.1" }, "tags": [ { @@ -58,7 +58,14 @@ }, "/static/swagger-initializer.js": { "get": { + "summary": "Used internally by the Swagger UI", + "tags": [ + "Auxiliary" + ], "responses": { + "200": { + "description": "The response body is JavaScript used internally by the Swagger UI" + }, "504": { "description": "\nRequest timed out. When handling this response, clients\nshould wait the number of seconds specified in the\n`Retry-After` header and then retry the request.\n" } diff --git a/src/azul/chalice.py b/src/azul/chalice.py index ccd1f0ac4..882aa0cd3 100644 --- a/src/azul/chalice.py +++ b/src/azul/chalice.py @@ -702,7 +702,15 @@ def swagger_ui(): interactive=False, cache_control=self._http_cache_for(60), cors=True, - method_spec={} + method_spec={ + 'summary': 'Used internally by the Swagger UI', + 'tags': ['Auxiliary'], + 'responses': { + '200': { + 'description': 'The response body is JavaScript used internally by the Swagger UI' + } + } + } ) def swagger_initializer(): file_name = 'swagger-initializer.js.template.mustache'