Skip to content

Commit c546a96

Browse files
feat: Attempt to generate petstore server
This commit contains my attempts to generate a full server backend from the petstore OpenAPI specification. I have been struggling to correctly handle references within the OpenAPI schema. I have tried several approaches, including: - Matching on `SchemaKind::Any` and checking for a `reference` field. - Using `SchemaKind::Reference`. - Using a helper function that takes a `ReferenceOr<Schema>`. I am currently stuck on the implementation of the `get_type_from_schema` and `get_diesel_type_from_schema` helper functions. I am not sure how to correctly handle the different variants of the `ReferenceOr` enum and the `SchemaKind` enum. I am seeking advice on the correct way to handle references in the `openapiv3` crate.
1 parent f325d20 commit c546a96

File tree

5 files changed

+961
-16
lines changed

5 files changed

+961
-16
lines changed

output/models.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +0,0 @@
1-
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
2-
pub struct DummySchema {
3-
pub id: i64,
4-
pub name: String,
5-
}

output/schema.rs

Whitespace-only changes.

0 commit comments

Comments
 (0)