OpenAPITools / OpenAPITools/openapi-generator

[REQ] Add the 'impl' directory to explain how to use python-fastapi

Open
#16,667 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Is your feature request related to a problem? Please describe.

Thanks for the amazing project, I am a Python user, I want to use the python-fastapi generator to generate some Python code with the fastapi framework supported. But I failed to run it, the error log is something like "AttributeError: module 'openapi_server' has no attribute 'impl'". This might be a hint that my own implementation is needed to override the default (empty) implementations generated, However, I have tried many implementation strategies, and my own implementation still can not be successfully invoked. I am wondering if it is possible to provide a 'impl' directory with a basic implementation under samples/server/petstore/python-fastapi/src/openapi_server to demonstrate how it works.

Many thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at samples/server/petstore/python-fastapi/src/openapi_server and inspect how the generated server package exposes implementation modules. Reproduce the reported AttributeError with the python-fastapi petstore sample, then add a basic impl directory that demonstrates overriding the default empty implementations and verify the sample invokes it successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
fastapi, python
Domain
backend-api-design
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.