You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
None of the versioning decorators work with namespaces, and there's no way of adjusting explicitly named routes without creating new types. Maybe we've been doing stuff wrong, but this meant that doing a recent API version bump was less smooth than I would have liked.
A simplified example - we started with:
@versioned(Versions)
namespace Service;
@route("/things")
namespace Service.Things;
model Item {
...
}
op list: []Item;
...more operations
We wanted to rename "things" to "stuff". I ended up having to:
Rename the namespace to Stuff, which renamed a bunch of the generated openapi components
Create a new interface, and move the route and the operations into it
Mark the interface as "removed" in v2
Create a second interface that extends the first, and mark it as "added" in v2
My issues:
Renaming the Things namespace to Stuff caused a bunch of generated openapi components in the v1 spec to be renamed. Not the end of the world, but some people might consider that a breaking change. We could have duplicated the namespace and renamed the copy, but that doesn't feel ideal
Changing the route required a new interface that just extends the first one. I'd much prefer to just have the one interface be able to change the route depending on the version
That being said, the experience is still miles better than working with raw openapi
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
None of the versioning decorators work with namespaces, and there's no way of adjusting explicitly named routes without creating new types. Maybe we've been doing stuff wrong, but this meant that doing a recent API version bump was less smooth than I would have liked.
A simplified example - we started with:
We wanted to rename "things" to "stuff". I ended up having to:
Stuff
, which renamed a bunch of the generated openapi componentsroute
and the operations into itMy issues:
Things
namespace toStuff
caused a bunch of generated openapi components in the v1 spec to be renamed. Not the end of the world, but some people might consider that a breaking change. We could have duplicated the namespace and renamed the copy, but that doesn't feel idealThat being said, the experience is still miles better than working with raw openapi
Beta Was this translation helpful? Give feedback.
All reactions