{"id":26256724,"url":"https://github.com/netcracker/qubership-apihub-http-spec","last_synced_at":"2025-10-08T14:52:11.025Z","repository":{"id":270128758,"uuid":"907631106","full_name":"Netcracker/qubership-apihub-http-spec","owner":"Netcracker","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-06T12:56:51.000Z","size":1159,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-06T13:47:06.482Z","etag":null,"topics":["apihub"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Netcracker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-24T03:14:54.000Z","updated_at":"2025-02-06T12:56:13.000Z","dependencies_parsed_at":"2025-02-06T13:51:22.317Z","dependency_job_id":null,"html_url":"https://github.com/Netcracker/qubership-apihub-http-spec","commit_stats":null,"previous_names":["netcracker/qubership-apihub-http-spec"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netcracker%2Fqubership-apihub-http-spec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netcracker%2Fqubership-apihub-http-spec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netcracker%2Fqubership-apihub-http-spec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netcracker%2Fqubership-apihub-http-spec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Netcracker","download_url":"https://codeload.github.com/Netcracker/qubership-apihub-http-spec/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243475361,"owners_count":20296714,"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":["apihub"],"created_at":"2025-03-13T20:18:56.111Z","updated_at":"2025-10-08T14:52:11.007Z","avatar_url":"https://github.com/Netcracker.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# qubership-apihub-http-spec\n\n## Modifications\nFork of the [@stoplightio/http-spec](https://github.com/stoplightio/http-spec)\n- Diff data stored in the model\n\n## What is it?\n\nHTTP Spec is yet another, hopefully more pragmatic, attempt to standardise OpenAPI v2, OpenAPI v3, Postman Collections and other HTTP-related specification under a single AST to rule them all (at least in Stoplight).\n\nThere have been a lot of other attempts to have a universal specification such as API Elements, API Flow and they all failed for a number of reasons.\n\n## Why build it?\n\nStoplight needs a way to interact with these documents in a standardized way, and relying on some dying intermediate format does not make that much sense. It's better to accept the sad state of the industry and work on a minimal superset format that can encompass the majority of the use cases.\n\n## How's HTTP Spec formed?\n\nThis repository contains *exclusively* converters functions that take OpenAPI v2, OpenAPI v3.x, or Postman Collection documents and transforms them into the [http-spec interface](https://github.com/stoplightio/types/blob/master/src/http-spec.ts).\n\nYou can explore the whole structure by looking at the [IHttpService](https://github.com/stoplightio/types/blob/master/src/http-spec.ts#L10) definition and checking out its descendands. You'll probably notice that it resembles a lot the current OpenAPI 3.x specification, and that's on purpose. OpenAPI 3.0 has first support and we gracefully upgrade/downgrade the other specification formats to it.\n\n## How do I write a converter?\n\nIf you would like to add support for another API description format, like RAML, follow these steps:\n\n1. Create a new directory in the `src/` directory\n2. Create a function that from your input returns an `IHttpService`\n3. Let the TypeScript errors guide you while filling out the missing fields (such as Security Schemes, Servers)\n4. Create a function that's able to return an array of `IHttpOperation` from your own input\n5. Profit\n\n## IHttpOperation merger\n\n`src/merge.ts` contains a utility that reduces the list of `IHttpOperation`'s into a minimal set. This tool particularly handy if you have a recorded list of request/response pairs, and you want to infer a specification out of it.\n\nThe strategy is the following:\n1. group operations by paths\n2. for each group:\n    1. merge request definitions, headers, query parameters, body schemas\n    2. group responses by the code\n    3. for each response code:\n        1. merge headers, examples, encodings, ...\n        2. group contents by media type\n        3. for each media type: merge body schemas\n\n### Merging strategy highlights\n\n- Conflicting examples will make the merger relax the constraints. That means e.g. if a header is required in one request and not required in another one then the resulting operation will *not* require that header to be present.\n- Different JSON Schemas are coupled with `anyOf`.\n- By default, additionalProperties are permitted.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetcracker%2Fqubership-apihub-http-spec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetcracker%2Fqubership-apihub-http-spec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetcracker%2Fqubership-apihub-http-spec/lists"}