3 ms·
The "client library" being referred to is an autogenerated API client, like https://github.com/swagger-api/swagger-js https://github.com/swagger-api/swagger-js.
by theptip 10y ago
The "client library" being referred to is an autogenerated API client, like https://github.com/swagger-api/swagger-js https://github.com/swagger-api/swagger-js.
Recent DRF releases have been building the CoreAPI schema definition format, which is a generic schema language like OpenAPI (nee Swagger) or API Blueprint.
The other headline DRF feature (API docs) also builds on the CoreAPI schema.
If you prefer existing standards, you can map your DRF API to Swagger using https://github.com/marcgibbons/django-rest-swagger/ https://github.com/marcgibbons/django-rest-swagger/, and then use swagger-js (or swagger-codegen) to generate client implementations -- though the django-rest-swagger project is currently partially broken due to having migrated to CoreAPI before the latter obtained feature-parity with Swagger; the 0.3 version is more full-featured.
- tomchristie 10y agoTo be precise I'd call it a "dynamic API client". The codebase doesn't change, you read the schema and corresponding actions become available on the client. There are also "autogenerated API clients", where the API code is templated, based on the API schema. (I think the swagger-js client also falls into the "dynamic" category, tho most other language implementations based on swagger fall into the templated "autogenerated" category.) And, yup, working towards bring Core API up to feature parity with Swagger, so that you can fully interoperate with everything that the Swagger ecosystem already provides.
- wing328hk 10y agoJust want to add that swagger-js is a "dynamic" API client, which means it will load the OpenAPI/Swagger spec [1] during runtime. If you prefer static API clients/SDKs, please try Swagger Codegen [2] (free, open-source) instead, which supports 30+ API clients and 20+ server stubs as well as API documentations. [1] https://github.com/OAI/OpenAPI-Specification https://github.com/OAI/OpenAPI-Specification [2] https://github.com/swagger-api/swagger-codegen https://github.com/swagger-api/swagger-codegen Disclosure: I'm a top contributor to Swagger Codegen.