Skip to content

Conversation

@tray2100
Copy link
Contributor

(#9558) This PR adds a new usePythonSrcRootInImports flag to allow a user of the generator to specify that they want the pythonSrcRoot value included in the namespaces generated. The default value of false leaves the output as is today. I added this change into the AbstractPythonConnexionServerCodegen so all the extending generators can benefit from it.

I've added a new unit test suite against the AbstractPythonConnexionServerCodegen since one didn't exist. In there I use a dataProvider to test that with the new flag off that there are no changes to what is generated now and that with the flag on the appropriate paths for file generation and import namespaces are changed.

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master, 5.1.x, 6.0.x
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

cc: @taxpon @frol @mbohlool @cbornet @kenjones-cisco @tomplus @Jyhess @arun-nalla @spacether

@tray2100 tray2100 force-pushed the pythonSrcRootFix branch from e112d44 to 062d0fb Compare May 23, 2021 21:43
@tray2100
Copy link
Contributor Author

tray2100 commented May 23, 2021

Oops! I didn't make the tests that check a "path" platform agnostic. I'm force pushing a consolidated commit with this fix to make this easier to merge.

@tray2100 tray2100 force-pushed the pythonSrcRootFix branch from 062d0fb to 97e0780 Compare May 23, 2021 22:01
@tray2100
Copy link
Contributor Author

The tests failures seem to be unrelated to my change since they're occurring in the csharp suite and I never made any changes to the Petstore example.

@spacether spacether added this to the 5.2.0 milestone Jun 2, 2021
Copy link
Contributor

@spacether spacether left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good; thank you for your PR!

@spacether spacether merged commit 7bb7c72 into OpenAPITools:master Jun 2, 2021
@tray2100 tray2100 deleted the pythonSrcRootFix branch June 2, 2021 18:30
@wing328 wing328 changed the title Adding usePythonSrcRootInImports logic to AbstractPythonConnexionServerCodegen. (#9558) Adding usePythonSrcRootInImports logic to AbstractPythonConnexionServerCodegen Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants