{"id":15091453,"url":"https://github.com/denganjia/openapi-schema","last_synced_at":"2025-04-12T07:11:04.523Z","repository":{"id":168911324,"uuid":"643807696","full_name":"denganjia/openapi-schema","owner":"denganjia","description":"Rust structure mapped to Swagger","archived":false,"fork":false,"pushed_at":"2023-06-21T02:12:47.000Z","size":196,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T02:22:52.881Z","etag":null,"topics":["oas","openapi","rust","swagger"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/denganjia.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":"2023-05-22T07:45:37.000Z","updated_at":"2023-07-29T06:31:07.000Z","dependencies_parsed_at":"2024-09-30T07:01:04.370Z","dependency_job_id":"b31b145a-82c0-42e9-9eb0-2119e372015d","html_url":"https://github.com/denganjia/openapi-schema","commit_stats":{"total_commits":15,"total_committers":2,"mean_commits":7.5,"dds":"0.19999999999999996","last_synced_commit":"ae385f4f0e2a88770c2c4167a2b6a3ea801ac20a"},"previous_names":["denganjia/openapi-schema"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denganjia%2Fopenapi-schema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denganjia%2Fopenapi-schema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denganjia%2Fopenapi-schema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denganjia%2Fopenapi-schema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denganjia","download_url":"https://codeload.github.com/denganjia/openapi-schema/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248530575,"owners_count":21119600,"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":["oas","openapi","rust","swagger"],"created_at":"2024-09-25T10:41:12.390Z","updated_at":"2025-04-12T07:11:04.499Z","avatar_url":"https://github.com/denganjia.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenApi-Schema\n\nRust structure mapped to openapi \n\nYou can use this package will openapi document into rust structure\n# Use\n```bash\ncargo add openapi-schema\n```\n```rust\nuse openapi_schema::{from_path, Doc};\n\nfn main() {\n    let filepath = \"./index.json\";\n    let json = from_path(filepath);\n    match json {\n        Ok(some_doc) =\u003e match some_doc {\n            Doc::V2(swagger) =\u003e {\n                println!(\"swagger version:{}\", swagger.swagger)\n            }\n            Doc::V3(openapi) =\u003e {\n                println!(\"openapi version:{}\", openapi.openapi)\n            }\n        },\n        Err(e) =\u003e {\n            println!(\"{:?}\", e)\n        }\n    }\n}\n```\n\n# Notice\n\nBecause some words are reserved words in rust, so will the json structure mapped to rust after structure, rust in the field name is different from some of json\n  |Rust|Json|\n  | --- | --- |\n  | r#type | type |\n  | r#enum | enum |\n  | r#in | in |\n  | reference | $ref |\n\n\u003eFor using camelCase in json representation of the field, use snake_case in rust","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenganjia%2Fopenapi-schema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenganjia%2Fopenapi-schema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenganjia%2Fopenapi-schema/lists"}