paperclip-rs / paperclip

WIP OpenAPI tooling for Rust.
Apache License 2.0
873 stars 115 forks source link

Actix plugin: Support basePath #53

Open wafflespeanut opened 5 years ago

wafflespeanut commented 5 years ago

If all the registered paths share a common base path, then we can split that out and set that to basePath field in the spec. I suggest adding a method normalize to paperclip::v2::models::GenericApi which mem::replaces and iterates over paths map to determines the base path. Whilst doing that, it also calls normalize method on the (OperationMap) values before adding it to the new map and setting it back in paths field.

arekbal commented 3 years ago

While developing I don't care about the domain it will be hosted, In order to provide it correctly spec would need to be aware of the host. It might be too much. But still I would like generacted client to allow me to set base_url.