A language for describing resource-oriented APIs & turning them into Swagger or resource diagrams. Oriented around the concepts we want to expose in the APIs.
Apache License 2.0
23
stars
7
forks
source link
When multiple MULTIGET endpoints exist, pagination model is shared #178
When more than one MULTIGET endpoint exists, the _pagination object is shared between the generated Swagger models. This is a problem because:
the pagination object's class name is tied to one of the models (for example, given Dog and Cat resources with MULTIGETs, it may be called DogMultiResponsePagination for both resources)
the class name is subject to change when new MULTIGET endpoints are added (for example, if we add a new Parrot resource with a MULTIGET, now the class may be called ParrotMultiResponsePagination for all three resources)
This forces the developer to change the class name as new features are added. The bug is that we are defining _pagination inline in the Swagger resource, whereas it should be a separate schema.
Medium priority, because a workaround exists.
Describe The Bug
When more than one MULTIGET endpoint exists, the
_pagination
object is shared between the generated Swagger models. This is a problem because:Dog
andCat
resources withMULTIGET
s, it may be calledDogMultiResponsePagination
for both resources)MULTIGET
endpoints are added (for example, if we add a newParrot
resource with aMULTIGET
, now the class may be calledParrotMultiResponsePagination
for all three resources)This forces the developer to change the class name as new features are added. The bug is that we are defining
_pagination
inline in the Swagger resource, whereas it should be a separate schema.This issue is a close relative of https://github.com/LiveRamp/reslang/issues/176.
To Reproduce
create any two resources with
MULTIGET
endpoints, generate Java code, observe class nameExpected Behavior
We should have a separate "pagination" object for each resource that needs one (
DogMultiResponsePagination
,CatMultiResponsePagination
).Reslang Version
5.1.1