{"id":27634704,"url":"https://github.com/stoneliucs/salt","last_synced_at":"2025-04-23T19:20:19.271Z","repository":{"id":287790775,"uuid":"965789625","full_name":"stoneliuCS/salt","owner":"stoneliuCS","description":"Structured API Language for OpenAPI schema generation, TypeScript generation, and zod validation generation.","archived":false,"fork":false,"pushed_at":"2025-04-18T05:09:42.000Z","size":98,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-18T18:11:59.067Z","etag":null,"topics":["dsl","openapi","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stoneliuCS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-04-13T22:44:42.000Z","updated_at":"2025-04-18T05:15:42.000Z","dependencies_parsed_at":"2025-04-18T18:12:01.702Z","dependency_job_id":null,"html_url":"https://github.com/stoneliuCS/salt","commit_stats":null,"previous_names":["stoneliucs/sal","stoneliucs/salt"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stoneliuCS%2Fsalt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stoneliuCS%2Fsalt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stoneliuCS%2Fsalt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stoneliuCS%2Fsalt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stoneliuCS","download_url":"https://codeload.github.com/stoneliuCS/salt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250497060,"owners_count":21440250,"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":["dsl","openapi","typescript"],"created_at":"2025-04-23T19:20:17.159Z","updated_at":"2025-04-23T19:20:19.251Z","avatar_url":"https://github.com/stoneliuCS.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# S.A.L.T\n\nA Structured Application Programming Interface Language for TypeScript APIs\n\n## Purpose\n\nS.A.L.T is an internal/embedded Domain Specific Language for expressing type-safe web APIs written in TypeScript through the OpenAPI specification.\n\nThe key features of SALT is an entirely type-safe, functional API to express an OpenAPI specification in TypeScript.\n\n- No dependencies, use as is.\n- Write the most complex OpenAPI specification you want, use whatever framework you want. Focus on business logic, have the interface logic abstracted away through 1 to 1 TypeScript type and validator generation.\n- Write the controllers you want, no frameworks to dictate how to write your APIs or controllers.\n\nDefining a complete API specification is made easy, it reads like english:\n\n```ts\n// Define Schemas for your OpenAPI specification:\nconst userEndpoint = new OpenApiRoute(\"/users/{id}\")\n  // Adds the Parameter to the OpenApiRoute path\n  .addOperation(\"GET\")\n  .addParameter(\"id\")\n  .addLocation(\"path\")\n  .additionalMetadata()\n\n  // Adds the reponse to the OpenApiRoute path\n  .addResponse(\"200\")\n  .addDescription(\"Successfully gotten user\")\n  .addHeaders() // Add additional headers if needed, or leave it blank.\n  .addContentType(OpenApiContentType.JSON)\n  .addSchema(successResponse)\n  .additionalMetadata() // Add additional metadata like examples if needed or leave it blank.\n\n  // Adds the reponse to the OpenApiRoute path\n  .addResponse(\"500\")\n  .addDescription(\"Internal Server Error\")\n  .addHeaders()\n  .addContentType(OpenApiContentType.JSON)\n  .addSchema(errorResponse)\n  .additionalMetadata()\n  // Finish the route\n  .return()\n\nconst metadata = new OpenApiMetadata()\n  .addVersion(\"3.0.0\")\n  .addInfo({ title: \"PetStore\", version: \"1.0.0\" })\n  .addRoute(userEndpoint);\n\nconst openapi = new OpenApiBuilder(metadata);\n\nopenapi.toOpenApi();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstoneliucs%2Fsalt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstoneliucs%2Fsalt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstoneliucs%2Fsalt/lists"}