William Cheng bb831dad9a
Make the rust hyper client Send so it can be used in rust threads more easily (#19375)
* Add externCrateName property to rust hyper client

This is follows the lead of the rust hyper server generator and provides
an externCrateName. This is because the crate name used for importing
can be different from the package name, because dashes `-` get converted
to underscores `_`.

This allows us to write example code in rustdoc that compiles
successfully.

* Get the rustdoc examples to actually compile

* Make rust hyper client thread safe

* Fix compile time issue with reqwest client test

* Add a test for thread safety

* Generate rust hyper samples

* Use https for petstore api to fix client tests

http://petstore.swagger.io/v2 is 301 redirecting to
https://petstore.swagger.io/v2 and this is breaking posts to the API.
When the client recieves a redirect it does not resend the POST data,
instead it switches to GET. This is in line with how browsers behave
when encountering a 301 redirect on a POST request.

* Make rust hyper client structs `Sync` too

This trait is also helpful in making the api work well with threads.

* Use a getCrateName function instead of adding more state

* update samples

---------

Co-authored-by: Krishna Rajendran <krishna@emptybox.org>
2024-08-17 16:01:11 +08:00
..
2024-07-02 16:45:53 +08:00

Rust API client for oneof-array-map-hyper

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

Overview

This API client was generated by the OpenAPI Generator project. By using the openapi-spec from a remote server, you can easily generate an API client.

  • API version: 0.0.1
  • Package version: 0.0.1
  • Generator version: 7.8.0-SNAPSHOT
  • Build package: org.openapitools.codegen.languages.RustClientCodegen

Installation

Put the package under your project folder in a directory named oneof-array-map-hyper and add the following to Cargo.toml under [dependencies]:

oneof-array-map-hyper = { path = "./oneof-array-map-hyper" }

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
DefaultApi root_get Get /
DefaultApi test Put /

Documentation For Models

To get access to the crate's generated documentation, use:

cargo doc --open

Author