This patch addresses an issue where csharp-netcore failed to generate compilable code when required attributes were of complex types.
By using the non-shorthand syntax for checking if the value is set, and throwing an error in that case, the compile issues have been resolved.
Closes#9442Closes#5442
Refs #3358
Ensure `deprecated` operations are annotated/documented as such on the
generated methods. Libraries updated:
* [feign]
* [google-api-client]
* [microprofile]
* [okhttp-gson]
* [resttemplate]
* [retrofit]
* [retrofit/play*]
* [webclient]
* [vertx]
Ensure `deprecated` schemas are annotated/documented as such on the
generated classes/fields. Libraries updated:
* [feign]
* [google-api-client]
* [jersey2]
* [microprofile]
* [native]
* [okhttp-gson]
* [rest-assured]
* [resteasy]
* [resttemplate]
* [retrofit*]
* [webclient]
* [vertx]
Also fix two minor bugs to get the java sample tests working:
* Fix an invalid jackson-datatype-threetenbp version number in vertx/pom.mustache
* Fix a bad return type in webclient/api_test.mustache when uniqueItems=true
Since this commit updates petstore-with-fake-endpoints-models-for-testing.yaml,
several other samples were updated, but it's just new files to reflect the
deprecated schemas, so there should be no consequential differences.
Relevant bits of the spec:
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#user-content-operationdeprecated
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#user-content-schemadeprecated
* conditional serialization add only those property which user wants to configure.
* fixed the samples
* fixed the sample String to string issue.
* fixed the sample String to string issue.
* updated the sample
* Added unit test for conditional serialization
* update samples
* remove trailing spaces, update samples
* remove files
* add back files
* build the project in the ci
Co-authored-by: William Cheng <wing328hk@gmail.com>
* Introduce FileParameter as an abstraction
* Update Samples
* Add new file to samples
* Fix hardcoded package name
* Fix hardcoded package name, import FileParameter in Model
* Remove unneccesary warning
* Removed obsolete attribute on constructors without HttpClient prameter
* add clickable link in the tooltip
* update doc, add tests
Co-authored-by: William Cheng <wing328hk@gmail.com>
* [csharp][netcore-httpclient] Reuse HttpClient, Allow use of external HttpClient.
* Updated samples
* Removed local variables no more useful
* Added InvalidOperationException when used a configuration not supported for the constructor
* Updated samples
* Do not allow not reusing HttpClient, fix socket exhaustion issues, add Readme on how to add your own client
* Add Readme change
* Alternative version via constructor injection
* Update samples
* Update usage in ExecAsync
* Clean Constructor
* Add Warning to constructor, Update Samples
* Add warning, fix last constructor, update samples
* Change client to private in constructor injection
* Add disposable to ApiClient
* Do not dispose handler if we did not create it
* Update samples
* Add disable switch and update samples and documentation
* Fix Request Body File Upload for RestSharp and csharp-netcore
* Update Samples
* Fix missing using and update samples
* Enable upload test
* Fix form data and file upload handling for httpclient, update samples