diff --git a/samtranslator/schema/sam.schema.json b/samtranslator/schema/sam.schema.json index 2d93693a0..55ba18fb2 100644 --- a/samtranslator/schema/sam.schema.json +++ b/samtranslator/schema/sam.schema.json @@ -2016,9 +2016,7 @@ "title": "OAuth2Authorizer", "type": "object" }, - "PassThroughProp": { - "title": "PassThroughProp" - }, + "PassThroughProp": {}, "PrimaryKey": { "additionalProperties": false, "properties": { diff --git a/samtranslator/schema/schema.json b/samtranslator/schema/schema.json index b5c6e2e6f..340c0e7ba 100644 --- a/samtranslator/schema/schema.json +++ b/samtranslator/schema/schema.json @@ -155547,9 +155547,7 @@ ], "type": "object" }, - "PassThroughProp": { - "title": "PassThroughProp" - }, + "PassThroughProp": {}, "PrimaryKey": { "additionalProperties": false, "properties": { diff --git a/samtranslator/schema/schema.py b/samtranslator/schema/schema.py index cbd84fdfe..8f705a24c 100644 --- a/samtranslator/schema/schema.py +++ b/samtranslator/schema/schema.py @@ -69,6 +69,11 @@ def get_schema(model: Type[pydantic.BaseModel]) -> Dict[str, Any]: # Validated in https://github.com/aws/serverless-application-model/blob/5c82f5d2ae95adabc9827398fba8ccfc3dbe101a/tests/schema/test_validate_schema.py#L91 obj["$schema"] = "http://json-schema.org/draft-04/schema#" + # Pydantic automatically adds title to model (https://github.com/pydantic/pydantic/issues/1051), + # and the YAML extension for VS Code then shows 'PassThroughProp' as title for pass-through + # properties (instead of the title of the property itself)... so manually deleting it. + del obj["definitions"]["PassThroughProp"]["title"] + return obj