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

chore: add schema types to LayerVersion #2620

Merged
merged 1 commit into from
Nov 18, 2022
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
39 changes: 37 additions & 2 deletions samtranslator/schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,22 @@
],
"additionalProperties": false
},
"LayerVersionContentUri": {
"title": "LayerVersionContentUri",
"type": "object",
"properties": {
"Bucket": {
"title": "Bucket"
},
"Key": {
"title": "Key"
},
"Version": {
"title": "Version"
}
},
"additionalProperties": false
},
"LayerVersionProperties": {
"title": "LayerVersionProperties",
"type": "object",
Expand All @@ -603,7 +619,15 @@
"title": "Compatibleruntimes"
},
"ContentUri": {
"title": "Contenturi"
"title": "Contenturi",
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/LayerVersionContentUri"
}
]
},
"Description": {
"title": "Description"
Expand All @@ -615,9 +639,20 @@
"title": "Licenseinfo"
},
"RetentionPolicy": {
"title": "Retentionpolicy"
"title": "Retentionpolicy",
"anyOf": [
{
"type": "string"
},
{
"type": "object"
}
]
}
},
"required": [
"ContentUri"
],
"additionalProperties": false
},
"AwsServerlessLayerVersion": {
Expand Down
26 changes: 16 additions & 10 deletions samtranslator/schema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,21 +132,27 @@ class AwsServerlessStateMachine(BaseModel):
Condition: Unknown


class LayerVersionContentUri(BaseModel):
Bucket: PassThrough
Key: PassThrough
Version: Optional[PassThrough]


class LayerVersionProperties(BaseModel):
CompatibleArchitectures: Unknown
CompatibleRuntimes: Unknown
ContentUri: Unknown
Description: Unknown
LayerName: Unknown
LicenseInfo: Unknown
RetentionPolicy: Unknown
CompatibleArchitectures: Optional[PassThrough]
CompatibleRuntimes: Optional[PassThrough]
ContentUri: Union[str, LayerVersionContentUri]
Description: Optional[PassThrough]
LayerName: Optional[PassThrough]
LicenseInfo: Optional[PassThrough]
RetentionPolicy: Optional[Union[str, SamIntrinsic]]


class AwsServerlessLayerVersion(BaseModel):
Type: Literal["AWS::Serverless::LayerVersion"]
Properties: LayerVersionProperties
Condition: Unknown
DeletionPolicy: Unknown
Condition: Optional[PassThrough]
DeletionPolicy: Optional[PassThrough]


class ApiProperties(BaseModel):
Expand Down Expand Up @@ -228,7 +234,7 @@ class ApplicationProperties(BaseModel):
class AwsServerlessApplication(BaseModel):
Type: Literal["AWS::Serverless::Application"]
Properties: ApplicationProperties
Condition: Unknown
Condition: Optional[PassThrough]


# Match anything not containing Serverless
Expand Down