8000 GitHub - igorskh/duolingo-api: Duolingo Unofficial OpenAPI Definition
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

igorskh/duolingo-api

Repository files navigation

Duolingo Unofficial API Definition

Description

Unofficial OpenAPI 2.0 (aka Swagger) definition for Duolingo API.

The validation and codegen was tested for Golang with go-swagger.

Code generation for other languages is possible with official swagger-codegen.

Check out interactive documentation.

Validate and Generate Server/Client Code

Validate documentation:

# go-swagger
swagger validate
# node.js swagger
npx swagger validate swagger.yaml

Generate client:

# go-swagger
swagger generate client -f ./duolingo-api/swagger.yaml
# swagger-codegen, e.g. for python
swagger-codegen generate -i swagger.yaml -l python -o ../py

See more documentation for Go swagger on https://goswagger.io.

Redoc Documentation

Generate interactive documentation with Redoc:

npx swagger-merger -i swagger.yaml -o swagger-complete.yaml
npx redoc-cli bundle swagger-complete.yaml

Usage of swagger-merger is required, because paths references are not resolved correctly with some third-party tools for swagger.

Mock Server with Prism

For mocking purpose Prism is used:

npx swagger-merger -i swagger.yaml -o swagger-complete.yaml
npx prism mock swagger-complete.yaml

Implementations

If you wish to add more implementations in other programming languages, I would be happy to support you. Also, if you want to extend the specification with more feaures, feel free to create a pull request.

0