Ignore specific files when generating the client #826
Replies: 6 comments
-
When you say files being overwritten, do you mean in the generated client? i.e. generate version A, update it to version B, but leave some files untouched? Or do you mean you want to ignore parts of the spec itself? If so this is likely a duplicate of #55 as that should get you where you need. |
Beta Was this translation helpful? Give feedback.
-
@clasnake , I think you are describing the same issue that I am facing: This generator does not seem to allow for files not generated from the spec inside the package. After a quick browse it appears that the same methods used to in the generate command are used in the update command, seen here. This means that the package is essentially wiped every time an update command is executed as far as I can tell. If I'm right, this means that potentially a .openapi-python-ignore is feasible with shutil, but an initial implementation may affect the generate and update commands. @emann , what I am describing is similar to what the openapi-generator tool has implemented. |
Beta Was this translation helpful? Give feedback.
-
@emann / @dbanty , I don't intend to push, but ...
|
Beta Was this translation helpful? Give feedback.
-
@bolbken in order:
|
Beta Was this translation helpful? Give feedback.
-
@dbanty Thanks for the quick, concise response. In the coming weeks I may take this on and attempt an implementation. This is truly a superior generator for python clients from openapi specs. Looking forward to potentially being able to contribute in the future. Thanks! :) |
Beta Was this translation helpful? Give feedback.
-
Hi @dbanty -- I am curious if you think this feature belongs in this library. I certainly do, though there seem to be several plausible implementations. |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
When generating the client from open api spec, sometimes we need to prevent some specific files to be overwritten. I haven't found a native support in openapi-python-client currently.
Describe the solution you'd like
We can follow the .gitignore pattern and provide something like .openapi_python_ignore.
Describe alternatives you've considered
N/A
Additional context
N/A
Beta Was this translation helpful? Give feedback.
All reactions