{"id":15611563,"url":"https://github.com/boxdot/openapi-schema","last_synced_at":"2025-04-28T12:21:40.935Z","repository":{"id":78593741,"uuid":"171151488","full_name":"boxdot/openapi-schema","owner":"boxdot","description":null,"archived":false,"fork":false,"pushed_at":"2019-05-18T11:05:20.000Z","size":53,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T09:31:32.511Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/boxdot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2019-02-17T17:36:33.000Z","updated_at":"2022-08-01T02:57:50.000Z","dependencies_parsed_at":"2023-03-24T06:34:39.724Z","dependency_job_id":null,"html_url":"https://github.com/boxdot/openapi-schema","commit_stats":{"total_commits":22,"total_committers":2,"mean_commits":11.0,"dds":0.2727272727272727,"last_synced_commit":"cce6573384781bbd58ba1a144e6d2029f632cff6"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boxdot%2Fopenapi-schema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boxdot%2Fopenapi-schema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boxdot%2Fopenapi-schema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boxdot%2Fopenapi-schema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boxdot","download_url":"https://codeload.github.com/boxdot/openapi-schema/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251311345,"owners_count":21569011,"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":[],"created_at":"2024-10-03T06:05:26.652Z","updated_at":"2025-04-28T12:21:40.916Z","avatar_url":"https://github.com/boxdot.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# openapi-schema [![build Status]][travis]\n\n[OpenAPI 3.0 Schema] generation library for Rust types.\n\nThe implementation is *experimental*. For now, we support only features needed to implement a simple\nspec generation from an `actix-web` application (cf. https://github.com/actix/actix-web/issues/310).\nIf you are interested in the library and want to use it in your project, feel free to extend the\nsupported types.\n\n## Example\n\n```rust\nuse openapi_schema::OpenapiSchema;\n\n/// A tag for a pet\n#[derive(OpenapiSchema)]\npub struct Tag {\n    pub id: u64,\n    pub name: Option\u003cString\u003e,\n}\n\nfn main() {\n    let mut spec = openapi::v3_0::Spec::default();\n    Tag::generate_schema(\u0026mut spec);\n    println!(\"{}\", serde_json::to_string_pretty(\u0026spec).unwrap());\n}\n```\n\nThe above example generates the following schema:\n\n```json\n{\n  \"openapi\": \"\",\n  \"info\": {\n    \"title\": \"\",\n    \"version\": \"\"\n  },\n  \"paths\": {},\n  \"components\": {\n    \"schemas\": {\n      \"Tag\": {\n        \"description\": \"A tag for a pet\",\n        \"required\": [\n          \"id\"\n        ],\n        \"properties\": {\n          \"id\": {\n            \"type\": \"number\",\n            \"format\": \"int64\",\n            \"minimum\": 0\n          },\n          \"name\": {\n            \"type\": \"string\"\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n## Features\n\n* [x] Primitive types `i64`, `u64`, `i32`, `u32`, `bool`, `String`\n* [x] `Option\u003cT\u003e`\n* [x] `Vec\u003cT\u003e`\n* [x] Simple Rust structs (no tuple and unit structs)\n* [x] C-like Rust enums (no non-trivial variants)\n* [x] Doc comments are used as `title` and `description` of the schema.\n* [x] Doc comments of attributes are used as `description` of the property.\n* [x] Support for `serde(flatten)`.\n\nTODO\n\n* [ ] Support for `serde(rename)`.\n* [ ] Support for `serde(default)`.\n\n\n## License\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or\n   http://www.apache.org/licenses/LICENSE-2.0)\n * MIT License ([LICENSE-MIT](LICENSE-MIT) or\n   http://opensource.org/licenses/MIT)\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in this document by you, as defined in the Apache-2.0 license,\nshall be dual licensed as above, without any additional terms or conditions.\n\n[OpenAPI 3.0 Schema]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#schemaObject\n[build Status]: https://travis-ci.com/boxdot/openapi-schema.svg?branch=master\n[travis]: https://travis-ci.com/boxdot/openapi-schema\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboxdot%2Fopenapi-schema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboxdot%2Fopenapi-schema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboxdot%2Fopenapi-schema/lists"}