-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
skeleton for openapi implementation #43
base: main
Are you sure you want to change the base?
Conversation
MANIFEST_DIR, file_name | ||
)); | ||
let expected_file = PathBuf::from(format!( | ||
"{}/tests/models/{}.openapi.jsoN", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jsoN?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
woops, will fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:) no problem
let title = if traits.contains_key(title_trait_id) { | ||
expect_string_trait_value(traits, title_trait_id) | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if this is the best way to go about extracting traits. I'd like to is_titled but HasTraits
is not implemented for Service
. Not sure how this all fits together just yet
This is the first of what I'm sure will be many, many commits to implement the openapi crate. I'm opening this as a draft PR so I can develop it in the open and get early feedback (which I would very much appreciate!).
My overall plan is to build it TDD style implementing all the tests in https://github.com/awslabs/smithy/tree/main/smithy-openapi/src/test/resources/software/amazon/smithy/openapi/fromsmithy. I've added one of them and some plumbing to run the test. Next step will be to make this test passes.
I looked around briefly and didn't find any openapi crates I liked. They all have additional functionality beyond just struct definitions for the types. I'll probably provide a model implementation in this repo inspired by the others just to reduce a dependency.Actually, this looks promising.
I'm excited to contribute!