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

Is there a way to not skip Enum(Struct) or Enum(Enum)? #537

Open
RaulTrombin opened this issue Sep 11, 2024 · 3 comments
Open

Is there a way to not skip Enum(Struct) or Enum(Enum)? #537

RaulTrombin opened this issue Sep 11, 2024 · 3 comments

Comments

@RaulTrombin
Copy link
Contributor

RaulTrombin commented Sep 11, 2024

Currently paperclip skips the
Enum{
Something ( something_else )
}
fields.

Is there a way to make the inner structure shows as a parameter?
example

 #[derive(Debug, Clone, Serialize, Deserialize, Apiv2Schema)]
pub enum DeviceManagerGetOptionsV1 {
    AutoCreate,
    List,
    Search,
    Request(some structure)
}

 #[api_v2_operation(tags("Device Manager"))]
#[get("device_manager/{selection}")]
async fn device_manager_get(
    manager_handler: web::Data<ManagerActorHandler>,
    selection: web::Path<DeviceManagerGetOptionsV1>,
) -> Result<Json<crate::device::manager::Answer>, Error> {
.....
}

Then, APIspec only shows the simple enums.
Is there a way to how the 'Request', and if it's selected, shows the strcuture field?

@tiagolobocastro
Copy link
Collaborator

s there a way to how the 'Request', and if it's selected, shows the strcuture field?

What do you mean by "show the structure field" ?

@RaulTrombin
Copy link
Contributor Author

s there a way to how the 'Request', and if it's selected, shows the strcuture field?

What do you mean by "show the structure field" ?

to not skip it,
make the enum route avaiable alongside with simple enums and make inner field avaiable as a parameter when we load the api spec on swager

@tiagolobocastro
Copy link
Collaborator

On your enum, is "some structure" data you'd expect as input? Or more slashes in the path?
Can you share an example including the expected generated openapi code?

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

No branches or pull requests

2 participants