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
I'm trying to weigh the pros and cons of swagger-js and swagger-codegen, and my biggest question about the former as I understand it is: is requesting an entire JSON spec a viable solution as my API grows? Is swagger-js intended to be used on the client (using its Swagger(url).then(client) form) or more as a component in a CI/CD pipeline (or both, or neither)?
For context, I have a React app (via create-react-app, non-ejected) and I'd like to include a programmatic Promise-based interface (SDK) to my backing API (which it seems swagger-codegen has issues with). Generally I like to avoid burdening end-users with unneeded network requests, especially if they're of substantial size like it seems a Swagger spec is. Any advice on this topic is appreciated. Thanks!
The text was updated successfully, but these errors were encountered:
is requesting an entire JSON spec a viable solution as my API grows?
Generally I like to avoid burdening end-users with unneeded network requests, especially if they're of substantial size like it seems a Swagger spec is.
That is something that only you can answer. Are your users going to be mostly on 3G mobile devices, or on fiber-to-the-premises connections in major cities? 😄
Also be aware of the fact that your swagger.json will change rather infrequently, on average, so you can take advantage of aggressive caching so that your users won't need to download it again and again. You can also use the Client in such a way that your swagger.json isn't fetched until the user intends to do something that involves your API.
I'm trying to weigh the pros and cons of
swagger-js
andswagger-codegen
, and my biggest question about the former as I understand it is: is requesting an entire JSON spec a viable solution as my API grows? Isswagger-js
intended to be used on the client (using itsSwagger(url).then(client)
form) or more as a component in a CI/CD pipeline (or both, or neither)?For context, I have a React app (via
create-react-app
, non-ejected) and I'd like to include a programmatic Promise-based interface (SDK) to my backing API (which it seemsswagger-codegen
has issues with). Generally I like to avoid burdening end-users with unneeded network requests, especially if they're of substantial size like it seems a Swagger spec is. Any advice on this topic is appreciated. Thanks!The text was updated successfully, but these errors were encountered: