Skip to content
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

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

brendo-m
Copy link

@brendo-m brendo-m commented Feb 24, 2022

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!

@brendo-m brendo-m marked this pull request as draft February 24, 2022 04:08
MANIFEST_DIR, file_name
));
let expected_file = PathBuf::from(format!(
"{}/tests/models/{}.openapi.jsoN",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jsoN?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woops, will fix

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:) no problem

Comment on lines +79 to +81
let title = if traits.contains_key(title_trait_id) {
expect_string_trait_value(traits, title_trait_id)
} else {
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants