openedx / edx-platform

The Open edX LMS & Studio, powering education sites around the world!
https://openedx.org
GNU Affero General Public License v3.0
7.45k stars 3.88k forks source link

drf-spectacular in lms #35869

Open awais786 opened 4 days ago

awais786 commented 4 days ago

Steps to run this PR.

  1. pip install drf-spectacular ( already added into requirements)
  2. Generate schema file using this command from shell python manage.py lms spectacular --file schema.yaml
  3. In case generate schema with json python manage.py lms spectacular --format openapi-json > schema.json
  4. Access the schema via url http://localhost:18000/lms-api/ui/
  5. Get this docker file from here
  6. Run the commend to generate a client using yaml docker run --rm -v /Users/awais.qureshi/Documents/devstack/todo/schema.yaml:/local/schema.yaml -v /Users/awais.qureshi/Documents/devstack/todo/newclient:/local/out openapitools/openapi-generator-cli generate -i /local/schema.yaml -g python -o /local/out