#trustfall #open-api #适配器 #规范 #维护 #维护者

openapi-trustfall-适配器

OpenAPI Trustfall 适配器

3 个不稳定版本

0.2.0 2024年4月18日
0.1.1 2024年4月16日
0.1.0 2024年4月15日

2157Web 编程

Download history 8/week @ 2024-04-21 7/week @ 2024-05-19

每月下载 99

MIT 许可证

32KB
769 代码行

OpenAPI Trustfall 适配器

用于 v3.0.x 规范的 OpenAPI Trustfall 适配器。

注意:此适配器不由 Trustfall 维护者维护。

规范


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
}

注意:在 AmazonApigatewayIntegration 集成类型中,arn 属性期望以下特定格式

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

或者

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

它将尝试提取 some_service_arn 的值。

依赖项

~14MB
~313K SLoC