8000 add spec for ReceiveMessage operation · localstack/localstack@14d19ca · GitHub
[go: up one dir, main page]

Skip to content

Commit 14d19ca

Browse files
committed
add spec for ReceiveMessage operation
1 parent 8f18616 commit 14d19ca

File tree

2 files changed

+63
-1
lines changed

2 files changed

+63
-1
lines changed

localstack-core/localstack/openapi.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,35 @@ components:
211211
- error
212212
- subscription_arn
213213
type: object
214+
ReceiveMessageRequest:
215+
type: object
216+
description: https://github.com/boto/botocore/blob/develop/botocore/data/sqs/2012-11-05/service-2.json
217+
required:
218+
- QueueUrl
219+
properties:
220+
QueueUrl:
221+
type: string
222+
format: uri
223+
AttributeNames:
224+
type: array
225+
items:
226+
type: string
227+
MessageSystemAttributeNames:
228+
type: array
229+
items:
230+
type: string
231+
MessageAttributeNames:
232+
type: array
233+
items:
234+
type: string
235+
MaxNumberOfMessages:
236+
type: integer
237+
VisibilityTimeout:
238+
type: integer
239+
WaitTimeSeconds:
240+
type: integer
241+
ReceiveRequestAttemptId:
242+
type: string
214243
ReceiveMessageResult:
215244
type: object
216245
description: https://github.com/boto/botocore/blob/develop/botocore/data/sqs/2012-11-05/service-2.json
@@ -566,6 +595,39 @@ paths:
566595
text/xml: {}
567596
application/json: {}
568597
description: Not found
598+
post:
599+
summary: Retrieves one or more messages from the specified queue.
600+
description: |
601+
This API receives messages from an SQS queue.
602+
https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html#API_ReceiveMessage_ResponseSyntax
603+
operationId: receive_message
604+
requestBody:
605+
required: true
606+
content:
607+
application/x-www-form-urlencoded:
608+
schema:
609+
$ref: '#/components/schemas/ReceiveMessageRequest'
610+
application/json:
611+
schema:
612+
$ref: '#/components/schemas/ReceiveMessageRequest'
613+
responses:
614+
'200':
615+
content:
616+
text/xml: {}
617+
application/json:
618+
schema:
619+
$ref: '#/components/schemas/ReceiveMessageResult'
620+
description: SQS queue messages
621+
'400':
622+
content:
623+
text/xml: {}
624+
application/json: {}
625+
description: Bad request
626+
'404':
627+
content:
628+
text/xml: {}
629+
application/json: {}
630+
description: Not found
569631
/_aws/sqs/messages/{region}/{account_id}/{queue_name}:
570632
get:
571633
description: List SQS messages without side effects

localstack-core/localstack/services/sqs/provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ def __init__(self, stores=None):
624624
self.service = load_service("sqs-query")
625625
self.serializer = create_serializer(self.service)
626626

627-
@route("/_aws/sqs/messages")
627+
@route("/_aws/sqs/messages", methods=["GET", "POST"])
628628
@aws_response_serializer("sqs-query", "ReceiveMessage")
629629
def list_messages(self, request: Request) -> ReceiveMessageResult:
630630
"""

0 commit comments

Comments
 (0)
0