{"id":46481388,"url":"https://github.com/block65/openapi-constructs","last_synced_at":"2026-03-06T08:16:19.940Z","repository":{"id":48278077,"uuid":"516819399","full_name":"block65/openapi-constructs","owner":"block65","description":"An experimental AWS Constructs based Open API schema builder","archived":false,"fork":false,"pushed_at":"2024-11-06T03:40:54.000Z","size":397,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-05T17:43:33.759Z","etag":null,"topics":["constructs","json-schema","openapi","swagger"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/block65.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-07-22T16:34:09.000Z","updated_at":"2024-11-06T03:40:58.000Z","dependencies_parsed_at":"2024-11-06T04:24:26.907Z","dependency_job_id":"46e50978-0ba5-4a04-8193-257a38b59004","html_url":"https://github.com/block65/openapi-constructs","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/block65/openapi-constructs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block65%2Fopenapi-constructs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block65%2Fopenapi-constructs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block65%2Fopenapi-constructs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block65%2Fopenapi-constructs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/block65","download_url":"https://codeload.github.com/block65/openapi-constructs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block65%2Fopenapi-constructs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29477304,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T11:35:25.641Z","status":"ssl_error","status_checked_at":"2026-02-15T11:34:57.128Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["constructs","json-schema","openapi","swagger"],"created_at":"2026-03-06T08:16:19.282Z","updated_at":"2026-03-06T08:16:19.931Z","avatar_url":"https://github.com/block65.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @block65/openapi-constructs\n\nAn experimental AWS Constructs based Open API schema builder\n\n## Example\n\n```typescript\nimport {\n  Api,\n  OpenApiVersion,\n  Parameter,\n  Path,\n  Reference,\n  Response,\n  Schema,\n  SecurityRequirement,\n  SecurityScheme,\n  Server,\n  Tag,\n  HttpMethods,\n} from '@block65/openapi-constructs';\n\nconst api = new Api({\n  openapi: OpenApiVersion.V3_1,\n  info: {\n    title: 'Example REST API',\n    version: '1.0.0',\n  },\n});\n\nnew Server(api, 'ExampleServer', {\n  url: new URL('https://api.example.com'),\n});\n\nconst httpBearerJwtScheme = new SecurityScheme(api, 'HttpBearerJwtScheme', {\n  type: 'http',\n  scheme: 'bearer',\n  bearerFormat: 'JWT',\n});\n\nnew SecurityRequirement(api, 'AllScopes', {\n  securityScheme: httpBearerJwtScheme,\n  scopes: [],\n});\n\nconst userTag = new Tag(api, 'UserTag', {\n  name: 'user',\n});\n\nconst userDeleteScopeReq = new SecurityRequirement(api, 'UserDeleteScope', {\n  securityScheme: httpBearerJwtScheme,\n  scopes: ['users.delete'],\n});\n\nconst noSecurityRequirement = new SecurityRequirement(api, 'NoSecurity');\n\nconst addressSchema = new Schema(api, 'Address', {\n  schema: {\n    type: 'object',\n    required: ['name'],\n    additionalProperties: false,\n    properties: {\n      postcode: {\n        type: 'integer',\n        format: 'int32',\n        minimum: 1000,\n        maximum: 9999,\n      },\n    },\n  },\n});\n\nconst idSchema = new Schema(api, 'Id', {\n  schema: {\n    type: 'string',\n    minLength: 6,\n    maxLength: 6,\n  },\n});\n\nconst user = new Schema(api, 'User', {\n  schema: {\n    type: 'object',\n    required: ['name'],\n    additionalProperties: false,\n    properties: {\n      userId: idSchema.referenceObject(),\n      name: {\n        type: 'string',\n      },\n      address: addressSchema.referenceObject(),\n      age: {\n        type: 'integer',\n        format: 'int32',\n        minimum: 0,\n      },\n    },\n  },\n});\n\nconst updateUserRequest = new Schema(api, 'UpdateUserRequest', {\n  schema: {\n    type: 'object',\n    minProperties: 1,\n    additionalProperties: false,\n    properties: {\n      address: addressSchema.referenceObject(),\n      age: {\n        type: 'integer',\n        format: 'int32',\n        minimum: 0,\n      },\n    },\n  },\n});\n\nconst createUserRequest = new Reference(user, 'CreateUserRequest');\n\nconst users = new Schema(api, 'Users', {\n  schema: {\n    type: 'array',\n    uniqueItems: true,\n    items: user.referenceObject(),\n  },\n});\n\nconst userIdParameter = new Parameter(api, 'UserId', {\n  name: 'userId',\n  in: 'path',\n  required: true,\n  schema: idSchema,\n});\n\nnew Path(api, {\n  path: '/users',\n  tags: new Set([userTag]),\n})\n  .addOperation(HttpMethods.GET, {\n    operationId: 'listUsersCommand',\n    responses: {\n      200: new Response(api, 'ListUsersResponse', {\n        description: 'User 200 response',\n        content: {\n          contentType: 'application/json',\n          schema: users,\n        },\n      }),\n    },\n  })\n  .addOperation(HttpMethods.POST, {\n    operationId: 'createUserCommand',\n    requestBody: {\n      content: {\n        contentType: 'application/json',\n        schema: createUserRequest,\n      },\n    },\n    responses: {\n      200: new Response(api, 'CreateUserResponse', {\n        description: 'User 200 response',\n        content: {\n          contentType: 'application/json',\n          schema: users,\n        },\n      }),\n    },\n  });\n\nnew Path(api, {\n  path: '/users/{userId}',\n  parameters: [userIdParameter],\n})\n  .addOperation(HttpMethods.GET, {\n    operationId: 'getUserByIdCommand',\n    responses: {\n      200: new Response(api, 'GetUserById', {\n        description: 'User 200 response',\n        content: {\n          contentType: 'application/json',\n          schema: user,\n        },\n      }),\n    },\n  })\n  .addOperation(HttpMethods.DELETE, {\n    operationId: 'deleteUserByIdCommand',\n    security: userDeleteScopeReq,\n  })\n  .addOperation(HttpMethods.HEAD, {\n    operationId: 'checkUserIdAvailableCommand',\n    security: noSecurityRequirement,\n  })\n  .addOperation(HttpMethods.POST, {\n    operationId: 'updateUserCommand',\n    requestBody: {\n      content: {\n        contentType: 'application/json',\n        schema: updateUserRequest,\n      },\n    },\n    responses: {\n      200: new Response(api, 'UpdateUserResponse', {\n        content: {\n          contentType: 'application/json',\n          schema: user,\n        },\n      }),\n    },\n  });\n\nprocess.stdout.write(JSON.stringify(api.synth(), null, 2));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblock65%2Fopenapi-constructs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblock65%2Fopenapi-constructs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblock65%2Fopenapi-constructs/lists"}