From fee732caff23f40d632027c5d66d4f729ff081d1 Mon Sep 17 00:00:00 2001 From: Nick Jackson Date: Thu, 9 Nov 2023 16:01:53 +0000 Subject: [PATCH] Remove unused method argument and references to it in docs --- openapi.yaml | 214 +++++++++++++------------ src/openapi_server/apis/writing_api.py | 9 -- 2 files changed, 111 insertions(+), 112 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index b6268a2..dcec110 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -3,52 +3,56 @@ info: title: Case Law Privileged API version: 0.1.2 servers: -- url: "https://{environment}.caselaw.nationalarchives.gov.uk/v1" - variables: - environment: - default: api - enum: - - api - - api.staging + - url: "https://{environment}.caselaw.nationalarchives.gov.uk/v1" + variables: + environment: + default: api + enum: + - api + - api.staging tags: -- description: Verify the operational state of the API - name: Status -- description: Operations for reading document content and metadata - name: Reading -- description: Operations for writing document content and metadata - name: Writing + - description: Verify the operational state of the API + name: Status + - description: Operations for reading document content and metadata + name: Reading + - description: Operations for writing document content and metadata + name: Writing paths: /status: get: - description: "A test endpoint that can be used by clients to verify service\ + description: + "A test endpoint that can be used by clients to verify service\ \ availability, and to verify valid authentication credentials.\nAuthentication\ \ is not required, but if it is provided, it will be checked for validity.\n" responses: "200": - description: "The service is available, and if authentication was provided,\ + description: + "The service is available, and if authentication was provided,\ \ the authentication is valid." "401": - description: "The service is available, but the provided authentication\ + description: + "The service is available, but the provided authentication\ \ was not valid." security: - - {} - - basic: [] + - {} + - basic: [] summary: Health check tags: - - Status + - Status /{judgmentUri}: get: - description: "Unless the client has `read_unpublished_documents` permission,\ + description: + "Unless the client has `read_unpublished_documents` permission,\ \ then only published documents are accessible." operationId: getDocumentByUri parameters: - - explode: false - in: path - name: judgmentUri - required: true - schema: - type: string - style: simple + - explode: false + in: path + name: judgmentUri + required: true + schema: + type: string + style: simple responses: "200": description: "A single judgment document, in Akoma Ntoso XML" @@ -61,7 +65,8 @@ paths: type: string style: simple X-Lock-State: - description: Included if the client has the `write_documents` role; + description: + Included if the client has the `write_documents` role; specifies if the document is currently locked for editing. example: true explode: false @@ -69,32 +74,33 @@ paths: type: boolean style: simple security: - - basic: - - read_documents - - read_unpublished_documents + - basic: + - read_documents + - read_unpublished_documents summary: "Read a judgment or decision, given its URI" tags: - - Reading + - Reading put: - description: "Write a complete new version of the document to the database,\ + description: + "Write a complete new version of the document to the database,\ \ and release any client lock." parameters: - - explode: false - in: path - name: judgmentUri - required: true - schema: - type: string - style: simple - - description: The last known version number of the document - example: "1" - explode: false - in: header - name: If-Match - required: true - schema: - type: string - style: simple + - explode: false + in: path + name: judgmentUri + required: true + schema: + type: string + style: simple + - description: The last known version number of the document + example: "1" + explode: false + in: header + name: If-Match + required: true + schema: + type: string + style: simple responses: "204": description: The document was updated successfully and any client lock released @@ -107,54 +113,52 @@ paths: style: simple "400": description: "The request was malformed, and the document was not modified" - "412": - description: "The document was not updated, as it has changed since the\ - \ version number specified If-Match. To avoid this, the client should\ - \ lock the document before making any changes to it." security: - - basic: - - write_documents + - basic: + - write_documents summary: Update a judgment tags: - - Writing + - Writing /{judgmentUri}/lock: get: parameters: - - explode: false - in: path - name: judgmentUri - required: true - schema: - type: string - style: simple + - explode: false + in: path + name: judgmentUri + required: true + schema: + type: string + style: simple responses: "204": description: Lock state included in header headers: X-Lock-State: - description: Included if the client has edit permissions; specifies + description: + Included if the client has edit permissions; specifies if the document is currently locked for editing. explode: false schema: type: boolean style: simple security: - - basic: - - write_documents + - basic: + - write_documents summary: Query lock status for a document tags: - - Writing + - Writing put: - description: "Locks edit access for a document for the current client. Returns\ + description: + "Locks edit access for a document for the current client. Returns\ \ the latest version of the locked document, alohg with the new lock state." parameters: - - explode: false - in: path - name: judgmentUri - required: true - schema: - type: string - style: simple + - explode: false + in: path + name: judgmentUri + required: true + schema: + type: string + style: simple responses: "201": description: "A single judgment document, in Akoma Ntoso XML" @@ -167,7 +171,8 @@ paths: type: string style: simple X-Lock-State: - description: Included if the client has the `write_documents` role; + description: + Included if the client has the `write_documents` role; specifies if the document is currently locked for editing. example: true explode: false @@ -178,58 +183,60 @@ paths: description: The document was already locked by another client headers: X-Lock-State: - description: Included if the client has edit permissions; specifies + description: + Included if the client has edit permissions; specifies if the document is currently locked for editing. explode: false schema: type: boolean style: simple security: - - basic: - - write_documents + - basic: + - write_documents summary: Lock access to a document tags: - - Writing + - Writing /{judgmentUri}/metadata: get: - description: "Unless the client has `read_unpublished_documents` permission,\ + description: + "Unless the client has `read_unpublished_documents` permission,\ \ then only metadata for published documents are accessible." parameters: - - explode: false - in: path - name: judgmentUri - required: true - schema: - type: string - style: simple + - explode: false + in: path + name: judgmentUri + required: true + schema: + type: string + style: simple responses: "200": description: OK security: - - basic: - - read_documents - - read_unpublished_documents + - basic: + - read_documents + - read_unpublished_documents summary: Gets the document's metadata tags: - - Reading + - Reading patch: parameters: - - explode: false - in: path - name: judgmentUri - required: true - schema: - type: string - style: simple + - explode: false + in: path + name: judgmentUri + required: true + schema: + type: string + style: simple responses: "200": description: OK security: - - basic: - - write_documents + - basic: + - write_documents summary: Set document properties tags: - - Writing + - Writing components: parameters: judgmentUri: @@ -262,7 +269,8 @@ components: type: string style: simple X-Lock-State: - description: Included if the client has the `write_documents` role; specifies + description: + Included if the client has the `write_documents` role; specifies if the document is currently locked for editing. example: true explode: false diff --git a/src/openapi_server/apis/writing_api.py b/src/openapi_server/apis/writing_api.py index 6cc856f..528e314 100644 --- a/src/openapi_server/apis/writing_api.py +++ b/src/openapi_server/apis/writing_api.py @@ -136,11 +136,6 @@ async def judgment_uri_lock_delete( 400: { "description": "The request was malformed, and the document was not modified", }, - 412: { - "description": """Not yet implemented: The document was not updated, as it has changed since - the version number specified If-Match. To avoid this, the client should - lock the document before making any changes to it.""", - }, }, tags=["Writing"], summary="Update a judgment", @@ -151,10 +146,6 @@ async def judgment_uri_patch( response: Response, judgmentUri: DocumentURIString, annotation: str = "", - if_match: str = Header( - None, - description="The last known version number of the document", - ), token_basic: TokenModel = SECURITY_TOKEN_MODEL, unlock: bool = False, ) -> dict[str, str]: