From 84bd7bfa4975849a2038a92fa3f8b8964c78f877 Mon Sep 17 00:00:00 2001 From: Artem Goncharov Date: Thu, 15 Aug 2024 16:34:27 +0200 Subject: [PATCH] Drop reading of identity.application_credential.access_rule We add decorators in Keystone and the hacks are not necessary anymore (actually they break since the schema got modified). Change-Id: I926397334d0e3b118a7c49ae6ed44bb26d1a169a --- .../application_credential.py | 32 +------------------ 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/codegenerator/openapi/keystone_schemas/application_credential.py b/codegenerator/openapi/keystone_schemas/application_credential.py index cb3a866..e2a5488 100644 --- a/codegenerator/openapi/keystone_schemas/application_credential.py +++ b/codegenerator/openapi/keystone_schemas/application_credential.py @@ -22,26 +22,6 @@ from codegenerator.common.schema import TypeSchema from codegenerator.common.schema import ParameterSchema from codegenerator.openapi.keystone_schemas import common -# Application Credentials -APPLICATION_CREDENTIAL_ACCESS_RULES_SCHEMA: dict[str, Any] = { - "type": "object", - "properties": { - "access_rules": copy.deepcopy( - application_credential_schema._access_rules_properties - ), - "links": copy.deepcopy(common.LINKS_SCHEMA), - }, -} - -APPLICATION_CREDENTIAL_ACCESS_RULE_SCHEMA: dict[str, Any] = { - "type": "object", - "properties": { - "access_rule": copy.deepcopy( - application_credential_schema._access_rules_properties["items"] - ) - }, -} - APPLICATION_CREDENTIAL_SCHEMA: dict[str, Any] = { "type": "object", "properties": { @@ -131,17 +111,7 @@ def _get_schema_ref( mime_type: str = "application/json" ref: str # ### Application Credentials - if name == "UsersAccess_RuleGetResponse": - openapi_spec.components.schemas.setdefault( - name, TypeSchema(**APPLICATION_CREDENTIAL_ACCESS_RULE_SCHEMA) - ) - ref = f"#/components/schemas/{name}" - elif name == "UsersAccess_RulesGetResponse": - openapi_spec.components.schemas.setdefault( - name, TypeSchema(**APPLICATION_CREDENTIAL_ACCESS_RULES_SCHEMA) - ) - ref = f"#/components/schemas/{name}" - elif name == "UsersApplication_CredentialsGetResponse": + if name == "UsersApplication_CredentialsGetResponse": openapi_spec.components.schemas.setdefault( name, TypeSchema(**APPLICATION_CREDENTIALS_SCHEMA) )