troposphere icon indicating copy to clipboard operation
troposphere copied to clipboard

How to write swagger body in RestApi ?

Open bluedusk opened this issue 7 years ago • 1 comments

I'm trying to write swagger in RestApi, How should I write ymal file in a dict ? Is there any example doing this ?

class RestApi(AWSObject):
    resource_type = "AWS::ApiGateway::RestApi"

    props = {
        "ApiKeySourceType": (basestring, False),
        "BinaryMediaTypes": ([basestring], False),
        "Body": (dict, False),
        "BodyS3Location": (S3Location, False),
        "CloneFrom": (basestring, False),
        "Description": (basestring, False),
        "EndpointConfiguration": (EndpointConfiguration, False),
        "FailOnWarnings": (basestring, False),
        "MinimumCompressionSize": (positive_integer, False),
        "Name": (basestring, False),
        "Parameters": ([basestring], False),
        "Policy": (dict, False),
    }

bluedusk avatar Jun 29 '18 05:06 bluedusk

Using yaml.load(...) (from PyYAML) returns a dict, which you can pass as the body.

More on StackOverflow.

dac456 avatar Jul 24 '18 17:07 dac456