Skip to content

Commit

Permalink
fixup! Implement example for schema
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Jan 25, 2020
1 parent 727b3a4 commit 7d12837
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion macros/src/openapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub fn derive_schema(mut input: DeriveInput) -> TokenStream {
let mut v = None;

attrs.iter().find(|attr| {
if attr.path.is_ident("example") {
if attr.path.is_ident("schema") {
for config in parse2::<Paren<Delimited<Meta>>>(attr.tokens.clone())
.expect("invalid schema config found while extracting example")
.inner
Expand Down
2 changes: 1 addition & 1 deletion tests/openapi_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ fn example_test() {
let yaml = serde_yaml::to_string(&spec).unwrap();
println!("{}", yaml);

panic!()
assert!(yaml.contains("10"));
}

0 comments on commit 7d12837

Please sign in to comment.