GREsau / GREsau/okapi

Name collision on request/response objects

Open
#16 3 comments 1 reaction 0 assignees View on GitHub
bug rocket-okapi
Dominant language
Rust
Stars
740
Forks
127
PR merge metrics
No merged PRs in 30d

Description

When two routes have the same name for a Request / Response the namespaces are clobbered. Example:

https://github.com/leeola/example_okapi_name_collision _([specifically this file](https://github.com/leeola/example_okapi_name_collision/blob/master/src/main.rs))_ will incorrectly report that the `/two` route has a response type of:

```
{
"reply": "string"
}
```

Instead of what it should be,

```
{
"different_schema": "string"
}
```

I'm happy to help developing a solution to this, but I'm unsure how best it can be handled. Ideally, I imagine something resembling idiomatic OpenAPI specs should be generated. Though, looking at the [classic PetStore example](https://petstore.swagger.io/) it looks like that entire bottom area is ripe for having many structure names occupy the same namespace.

Thoughts on how best to handle this?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.