{"id":13566016,"url":"https://github.com/Mermade/openapi-extract","last_synced_at":"2025-04-03T23:30:51.075Z","repository":{"id":28508990,"uuid":"118493814","full_name":"Mermade/openapi-extract","owner":"Mermade","description":"Extract single paths/operations from OpenAPI definitions","archived":false,"fork":false,"pushed_at":"2024-03-31T03:28:07.000Z","size":150,"stargazers_count":24,"open_issues_count":6,"forks_count":7,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-04-14T09:58:22.040Z","etag":null,"topics":["extract","extractor","metadata","microservice","microservices","openapi","openapi3","swagger"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mermade.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2018-01-22T17:56:20.000Z","updated_at":"2024-06-21T20:30:37.499Z","dependencies_parsed_at":"2024-01-19T07:02:11.484Z","dependency_job_id":"d87c1e7b-36fb-4c3f-b0e9-665037e2f205","html_url":"https://github.com/Mermade/openapi-extract","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mermade%2Fopenapi-extract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mermade%2Fopenapi-extract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mermade%2Fopenapi-extract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mermade%2Fopenapi-extract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mermade","download_url":"https://codeload.github.com/Mermade/openapi-extract/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247097633,"owners_count":20883122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["extract","extractor","metadata","microservice","microservices","openapi","openapi3","swagger"],"created_at":"2024-08-01T13:02:00.160Z","updated_at":"2025-04-03T23:30:50.058Z","avatar_url":"https://github.com/Mermade.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# openapi-extract\n\n![ci](https://github.com/Mermade/openapi-extract/workflows/ci/badge.svg)\n\nExtract paths, operations, parameters, schemas etc from OpenAPI/Swagger definitions.\n\nWorks with OpenAPI/Swagger 2.0 and 3.x definitions.\n\n```\nUsage: openapi-extract [options] {infile} [{outfile}]\n\nOptions:\n  -h, --help             Show help                                     [boolean]\n  --version              Show version number                           [boolean]\n  --openai               make the definition OpenAI compliant          [boolean]\n  --server               include server information                    [boolean]\n  --shard                shard the input to an output directory         [string]\n  -p, --path             the path to extract                            [string]\n  -o, --operationid      the operationIds to extract                     [array]\n  -m, --method           the method to extract for the given path       [string]\n  -i, --info             copy full info object, otherwise minimal      [boolean]\n  -d, --removeDocs       remove all externalDocs properties            [boolean]\n  -r, --removeExamples   remove all example/examples properties        [boolean]\n  -x, --removeExtensions remove all x- extension properties            [boolean]\n  -s, --security         include security information                  [boolean]\n  -v, --verbose          increase verbosity                            [boolean]\n```\n\nor\n\n```javascript\nconst openapiExtractor = require('openapi-extract');\nconst options = {};\n// options.path = '...';\n// options.method = '...';\n// options.operationid = ['...'];\nconst res = openapiExtractor.extract(obj, options);\n\nconst map = openapiExtractor.shard(obj, options);\n```\n\nThe `options` object takes the same values as the CLI, for these keys and default values:\n\n*   path = ''\n*   method = ''\n*   info = false\n*   openai = false\n*   removeDocs = false\n*   removeExamples = false\n*   removeExtensions = false\n*   server = false\n*   security = false\n*   operationid = []\n\n## OpenAI compliant mode\n\nThis option turns on the following rules:\n\n1. The `description` properties must have a maximum length of 300 characters\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMermade%2Fopenapi-extract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMermade%2Fopenapi-extract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMermade%2Fopenapi-extract/lists"}