Skip to content

Commit

Permalink
Added documentation for OpenApiAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
ralpha committed Dec 3, 2023
1 parent ef46dd7 commit 4cd9d72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ from most places, this includes:
[see this example](https://github.com/GREsau/okapi/blob/master/examples/custom_schema/src/error.rs).

Some more info can be provided using the `#[openapi(...)]` derive macro, for more info see:
[OpenApiAttribute](https://github.com/GREsau/okapi/blob/master/rocket-okapi-codegen/src/openapi_attr/mod.rs#L20).
[OpenApiAttribute](https://github.com/GREsau/okapi/blob/master/rocket-okapi-codegen/src/openapi_attr/mod.rs#L22).

[Schemars][Schemars] also can be used to provide more info for objects that implement
`#[derive(JsonSchema)]` using the `#[schemars(...)]` and `#[serde(...)]` syntax.
Expand Down
2 changes: 2 additions & 0 deletions rocket-okapi-codegen/src/openapi_attr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ use syn::{
PathSegment, ReturnType, Type, TypeTuple,
};

/// This structure documents all the properties that can be used in
/// the `#[openapi]` derive macro. for example: `#[openapi(tag = "Users")]`
#[derive(Debug, Default, FromMeta)]
#[darling(default)]
struct OpenApiAttribute {
Expand Down

0 comments on commit 4cd9d72

Please sign in to comment.