openapi-trustfall-adapter

Crates.ioopenapi-trustfall-adapter
lib.rsopenapi-trustfall-adapter
version0.2.0
sourcesrc
created_at2024-04-15 12:51:03.02448
updated_at2024-04-18 18:42:10.806425
descriptionOpenAPI Trustfall adapter
homepagehttps://github.com/ZimboPro/trustfall-adapters.git
repositoryhttps://github.com/ZimboPro/trustfall-adapters.git
max_upload_size
id1209193
size32,278
Leslie de Jager (ZimboPro)

documentation

README

OpenAPI Trustfall Adapter

A OpenAPI Trustfall adapter for the v3.0.x spec.

NOTE: This adapter is not maintained by the Trustfall maintainers.

Spec


type RootSchemaQuery {
    """
    OpenAPI doc info
    """
    Info: Info!
    
    """
    OpenAPI doc tags
    """
    Tags: [Tag!]!

    """
    OpenAPI doc paths
    """
    Paths: [Path!]!

    """
    OpenAPI doc path

    path: the path to the endpoint
    """
    Path(path: String!): Path

}

type Info {
    title: String!
    version: String!
    description: String
}

type Tag {
    name: String!
    description: String
}

type Path {
    path: String!
    get: Operation
    post: Operation
    put: Operation
    delete: Operation
    patch: Operation
    options: Operation
    operations: [Operation!]!
}

type Operation {
    summary: String
    method: String!
    description: String
    tags: [String!]
    xAmazonApigatewayIntegration: AmazonApigatewayIntegration
}

type AmazonApigatewayIntegration {
    type: String!
    httpMethod: String!
    uri: String!
    passthroughBehavior: String!
    timeoutInMillis: Int
    trigger: String!
    arn: String
}

NOTE: The arn property in the AmazonApigatewayIntegration integration type is expecting a specific format as follows:

x-amazon-apigateway-integration:
    ...
    uri: "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/${some_service_arn}/invocations"
    ...

OR

x-amazon-apigateway-integration:
    ...
    uri: "arn:aws:apigateway:${region}:lambda:path/2015-03-31/functions/${some_service_arn}/invocations"
    ...

It will try extract the value some_service_arn.

Commit count: 24

cargo fmt