Skip to content

Add source folder variable to fastapi fix 12118 #12119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

rk0n
Copy link
Contributor

@rk0n rk0n commented Apr 12, 2022

ref: #12118

What was done:

  • Add Codegen SourceFolder Variable to FastAPI Codegen

How to test changes:

  • Edit soureFolder Variable in bin/configs/python-fastapi.yaml
  • generate examples
  • check different folder in example

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.
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.
    @taxpon @frol @mbohlool @cbornet @kenjones-cisco @tomplus @spacether

@spacether
Copy link
Contributor

Hey there, your sample generation test is failing. Can you please rebase on master and regenerate your samples?

@rk0n
Copy link
Contributor Author

rk0n commented Apr 22, 2022

Hey there, your sample generation test is failing. Can you please rebase on master and regenerate your samples?

@spacether Will do it when I'm home again at the end of this week!

spacether and others added 24 commits April 24, 2022 20:23
* Adds code to detect json content type when charset is also set

* Updates template to properly render content type, regenerates samples

* Adds test_json_with_charset

* Reverts version file

* Fixes typo
* Add example allOf with single ref

* fix dart-dio-next handling of that case

* Refactor without vendor extension

* Regenerate newer samples
…2102)

* [typescript-fetch] drop support typescript under v4.0

* [typescript-fetch] update docs

* [typescript-fetch] update package-lock.json manually & fix test

* [typescript-fetch] fix test
…penAPITools#12109)

* remove old `dart-dio` generator which will be replaced by `dart-dio-next` in a seperate PR
* remove left-over `DartJaguarClinetCodegen` class which was sunset a while ago and is unused
…#12064)

* fix: respect configured generator URL in swagger config

The generated OpenAPI spec does not reflect the GENERATOR_HOST which causes wrong generated code and non-functional snippets in the UI.

This PR improves that by adding the relevant parts to the spec.

* style: use `OpenAPI` instead of `Swagger`

* refactor: make Set creation Java 8 compatible

* fix: add missing import
* [typescript-axios] drop support typescript below 4.0 & update samples

* [typescript-axios] update package.json & package-lock.json

* [typescript-node] drop support typescript below 4.0 & update samples

* [typescript-nestjs] drop support typescript below 4.0 & update samples

* [typescript-redux-query] drop support typescript below 4.0 & update samples

* [typescript-aurelia] drop support typescript below 4.0 & update samples

* [typescript-jquery] drop support typescript below 4.0 & update samples

* [typescript] drop support typescript below 4.0 & update samples
* test update sampels

* update samples

* add file
…ime is true. (OpenAPITools#12101)

* [typescript-fetch] remove unused function when withoutRuntimeCheks option to true

* [typescript-fetch] update samples
…est (OpenAPITools#11911)

* [kotlin][client] fix encoding (and Content-Type headers) of individual parts of a multipart request

* [kotlin][client] fix incorrect handling of binary downloads

* [kotlin][client] update samples
…APITools#12135)

* Adds issue spec file and attemts to generate code from it

* Adds missing schema definitions

* Skips fromProperty invocation if the passed in schema is none in getContent

* Makes MediaType.schema optional

* Adds checking that the content type is in self.content

* Sets ApiResponse body type as Unset if there is no schema for it

* Handles schema = None case

* Adds endpoint without response schema

* Reverts version files

* Adds test_response_without_schema
* Add monolog to templates

* Remove default values from DI\get helper

It turned out \DI\get expects only single argument, current method call
doesn't throw any errors but it should be corrected anyway.

* Refresh samples
Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](caolan/async@v2.6.3...v2.6.4)

---
updated-dependencies:
- dependency-name: async
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ITools#12142)

The default for `sourceFolder` in the documentation was wrong.
…to avoid shadowing fields named 'json' (OpenAPITools#12127) (OpenAPITools#12138)

* [Dart][client] Updated dart samples

Co-authored-by: 0xnf <0xnf>
* [dart] Support/Fix sourceFolder parameter and docs

* allow passing the sourceFolder to generators
* not sure how this translates to the dart2 generator due to the `part` files
* fix doc generation not showing default value of CLI options

* [dart] Delete old generator doc files
* [ruby] Add faraday 2.x support

* Remove redundant params_encoder config

* Memoize Faraday connection and refactor
wing328 and others added 23 commits April 24, 2022 20:23
…penAPITools#12104)

* better support of inline schema in array item

* update tests

* update samples

* regenerate samples

* fix allof naming, remove files

* add files

* update samples

* update readme

* fix tests

* update samples

* update samples

* add new files

* update test spec

* add back tests

* remove unused files

* comment out python test

* update js test using own spec

* remove files

* remove unused files

* remove files

* remove unused files

* better handling of allOf with a single type

* comment out go test

* remove test_all_of_with_single_ref_single_ref_type.py

* fix inline resolver, uncomment go test
…12175)

* better code format

* better code format, minor refactor
OpenAPITools#12043)

* Allow selection of MP REST API version for MicroProfile REST client generation

* fix typo in pom.xml

* fix typo in pom.xml, update samples

* add exception when incorrect MP Rest Client version is chosen
…APITools#12177)

* update microprofile api test to work with 3.0

* minor format change

* update samples
* Azure func return type

* Changed to Task<IActionResult<T>

* Readme
* improvements to csharp-netcore-function generator

* update samples

* update doc, samples
…ITools#12144)

The Micronaut generator by default adds the @nullable annotation to
non-required properties and allows using the Jackson JsonNullable
wrapper but it is not possible to use java.util.Optional as a wrapper
for optional properties.

This change adds support for using the Optional wrapper for non-required
properties.
…ols#12098)

* [typescript-fetch] allow initOverrides with async function

* [typescript-fetch] update samples

* [typescript-fetch] refactoring initFnction apply

* [typescript-fetch] update samples

* [typescript-fetch] refactoring create body function

* [typescript-fetch] update samples

* [typescript-fetch] make interface more flexible

* [typescript-fetch] update samples

* [typescript-fetch] support 2.x version of typescript & update samples

* [typescript-axios] update samples

* [typescript-fetch] refactor: add type alias

* [typescript-fetch] override with init params even if initOverrides is function

* [typescript-fetch] update samples
…les regarding Media type versioning (content negotiation) (OpenAPITools#12206)

* add wsdl version generation

* add option to use specified operationId

* update samples

* update cli description
Flask (and connexion by extension) allows the return type to be either
just the body, or the body & status code, or the body & status code &
headers.

This commit fixes the stated `rtype` to allow the latter two cases.
This fixes a minor duplication of the word "Api", which is already part
of the classname template parameter and doesn't need to be repeated when
structPrefix is set.
)

* Minor refactor for Micronaut generators

* Add support for security roles in micronaut server generator

* Micronaut Server Generator refactor the x-roles String variable

* Add support for Micronaut HttpResponse wrapper

* Generate samples

* Optimize the usage of context-path for Micronaut server
Fixes OpenAPITools#10772 for aspnetcore 3+

This allows numbers to be set to zero, and booleans to be set to false.
It may make sense to port this fix to the other C# generators,
though it was partially fixed (for booleans only) in the netcore client in PR9042.
@rk0n rk0n requested a review from jimschubert as a code owner April 24, 2022 18:25
@rk0n rk0n requested a review from spacether April 25, 2022 16:09
@spacether spacether added this to the 6.0.0 milestone Apr 25, 2022
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 20c37b5 into OpenAPITools:master Apr 26, 2022
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.