Skip to content

Commit

Permalink
Update FilterPolicy config to match AWS API
Browse files Browse the repository at this point in the history
Currently, filterPolicy configuration outlined in this file does not match what is outlined in the AWS documentation and API - https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-subscription.html. The `filterPolicy` should only contain the JSON policy, so no need for the `attributes` property; which in itself was confusing as the policy can apply to the message attributes or body.

Further to this, this definition file was missing the `filterPolicyScope` which is needed to determine whether the user wishes to filter on the message attributes or the body.
  • Loading branch information
Gadam8 authored Sep 18, 2023
1 parent a7f7f64 commit 6039889
Showing 1 changed file with 29 additions and 26 deletions.
55 changes: 29 additions & 26 deletions sns/json_schemas/operation.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
"filterPolicy": {
"$ref": "#/definitions/filterPolicy"
},
"filterPolicyScope": {
"$ref": "#/definitions/filterPolicyScope"
},
"rawMessageDelivery": {
"type": "boolean",
"description": "If true AWS SNS attributes are removed from the body, and for SQS, SNS message attributes are copied to SQS message attributes. If false the SNS attributes are included in the body."
Expand Down Expand Up @@ -169,37 +172,37 @@
},
"filterPolicy": {
"type": "object",
"description": "Only receive a subset of messages from the channel, determined by this policy.",
"description": "Only receive a subset of messages from the channel, determined by this policy. Depending on the FilterPolicyScope, a map of either a message attribute or message body to an array of possible matches. The match may be a simple string for an exact match, but it may also be an object that represents a constraint and values for that constraint.",
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/spec-json-schemas/v2.14.0/schemas/2.4.0.json#/definitions/specificationExtension"
}
},
"properties": {
"attributes": {
"type": "object",
"description": "A map of a message attribute to an array of possible matches. The match may be a simple string for an exact match, but it may also be an object that represents a constraint and values for that constraint.",
"additionalProperties": {
"oneOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "string"
},
{
"type": "object"
}
]
"additionalProperties": {
"oneOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "string"
},
{
"type": "object"
}
}
},
"required": [
"attributes"
]
]
}
},
"filterPolicyScope": {
"type": "string",
"description": "Determines whether the filterPolicy applies to MessageAttributes or MessageBody.",
"enum": [
"MessageAttributes",
"MessageBody"
],
"default": "MessageAttributes"
},
"redrivePolicy": {
"type": "object",
Expand Down Expand Up @@ -274,4 +277,4 @@
]
}
]
}
}

0 comments on commit 6039889

Please sign in to comment.