8000 Validate SES developer endpoints against OAS by giograno · Pull Request #11776 · localstack/localstack · GitHub
[go: up one dir, main page]

Skip to content

Validate SES developer endpoints against OAS #11776

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

Merged
merged 2 commits into from
Nov 5, 2024
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.
10000 Loading
Diff view
Diff view
54 changes: 36 additions & 18 deletions localstack-core/localstack/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,20 @@ servers:
default: 'localhost.localstack.cloud'
components:
parameters:
SesMessageId:
description: ID of the message (`id` field of SES message)
SesIdFilter:
description: Filter for the `id` field in SES message
in: query
name: id
required: false
schema:
type: string
SesEmailFilter:
description: Filter for the `source` field in SES message
in: query
name: email
required: false
schema:
type: string
SnsAccountId:
description: '`accountId` field of the resource'
in: query
Expand Down Expand Up @@ -124,6 +131,26 @@ components:
- completed
- scripts
type: object
SESDestination:
type: object
description: Possible destination of a SES message
properties:
ToAddresses:
type: array
items:
type: string
format: email
CcAddresses:
type: array
items:
type: string
format: email
BccAddresses:
type: array
items:
type: string
format: email
additionalProperties: false
SesSentEmail:
additionalProperties: false
properties:
Expand All @@ -139,7 +166,7 @@ components:
- text_part
type: object
Destination:
type: string
$ref: '#/components/schemas/SESDestination'
Id:
type: string
RawData:
Expand All @@ -160,13 +187,7 @@ components:
- Id
- Region
- Timestamp
- Destination
- RawData
- Source
- Subject
- Template
- TemplateData
- Body
type: object
SessionInfo:
additionalProperties: false
Expand Down Expand Up @@ -420,7 +441,7 @@ paths:
operationId: discard_ses_messages
tags: [aws]
parameters:
- $ref: '#/components/parameters/SesMessageId'
- $ref: '#/components/parameters/SesIdFilter'
responses:
'204':
description: Message was successfully discarded
Expand All @@ -429,13 +450,8 @@ paths:
operationId: get_ses_messages
tags: [aws]
parameters:
- $ref: '#/components/parameters/SesMessageId'
- description: Source of the message (`source` field of SES message)
in: query
name: email
required: false
schema:
type: string
- $ref: '#/components/parameters/SesIdFilter'
- $ref: '#/components/parameters/SesEmailFilter'
responses:
'200':
content:
Expand Down Expand Up @@ -580,7 +596,9 @@ paths:
responses:
'200':
content:
text/xml: {}
text/xml:
schema:
$ref: '#/components/schemas/ReceiveMessageResult'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This relates to SQS, not SES 😛 I was puzzled and spent a while trying to investigate why SES would return XML

application/json:
schema:
$ref: '#/components/schemas/ReceiveMessageResult'
Expand Down
1 change: 1 addition & 0 deletions tests/aws/services/ses/test_ses.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,7 @@ def test_special_tags_send_email(self, tag_name, tag_value, aws_client):
assert exc.match("MessageRejected")


@pytest.mark.usefixtures("openapi_validate")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL about this fixture. This would be very useful ⭐

class TestSESRetrospection:
@markers.aws.only_localstack
def test_send_email_can_retrospect(self, aws_client):
Expand Down
Loading
0