Suppose the api that we will use for openapi specs is
ucs
and the app that will consume the openapi spec iscore
First Approach
-
Generate and store openapi specs from the ucs in core - use
openapi-typescript
- need to runnpx openapi-typescript <ucs-swagger-json-url> -o ./src/common/openapi-specs/cloud-schema.d.ts
This may have a issue. We have to update each time using this
cmd
after any change in the spec of ucs.@see - https://github.com/drwpow/openapi-typescript/tree/main/packages/openapi-typescript
-
Use this specs in the endpoints of core and use http module or any other fetch module to fetch data from ucs - use
axios | feTs | openapi-fetch
Second Approach
- Use
cron once daily
to store the specs of ucs in the core. Should follow feTS way if you want to use feTS. - Use
feTS
package to handle http requests