mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-04 06:30:52 +00:00
[rust-server] add license and description to Cargo.toml (#7080)
* Move errant file to 'rust-server' Rust2 was the old name * Add license and description to Cargo.toml For rust-server, getting them from the swagger * Valid Java doesn't have uninitialised variables... * Default license to "Unlicense" * Set license to "Unlicense" for generated crates
This commit is contained in:
parent
da942ab80c
commit
a57fb0c7db
@ -2,6 +2,10 @@
|
||||
name = "{{packageName}}"
|
||||
version = "{{appVersion}}"
|
||||
authors = [{{#infoEmail}}"{{infoEmail}}"{{/infoEmail}}]
|
||||
{{#appDescription}}
|
||||
description = "{{{appDescription}}}"
|
||||
{{/appDescription}}
|
||||
license = "Unlicense"
|
||||
|
||||
[features]
|
||||
default = ["client", "server"]
|
||||
|
@ -4,10 +4,10 @@ import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class Rust2OptionsProvider implements OptionsProvider {
|
||||
public class RustServerOptionsProvider implements OptionsProvider {
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
return "rust2";
|
||||
return "rust-server";
|
||||
}
|
||||
|
||||
@Override
|
@ -2,6 +2,8 @@
|
||||
name = "petstore_api"
|
||||
version = "1.0.0"
|
||||
authors = ["apiteam@swagger.io"]
|
||||
description = "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\"
|
||||
license = "Unlicense"
|
||||
|
||||
[features]
|
||||
default = ["client", "server"]
|
||||
|
@ -13,7 +13,7 @@ To see how to make this your own, look here:
|
||||
[README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md)
|
||||
|
||||
- API version: 1.0.0
|
||||
- Build date: 2017-10-30T02:13:46.477Z
|
||||
- Build date: 2017-11-30T15:18:45.444Z
|
||||
|
||||
## Examples
|
||||
|
||||
|
@ -139,11 +139,11 @@ paths:
|
||||
type: "array"
|
||||
items:
|
||||
type: "string"
|
||||
default: "available"
|
||||
enum:
|
||||
- "available"
|
||||
- "pending"
|
||||
- "sold"
|
||||
default: "available"
|
||||
collectionFormat: "csv"
|
||||
formatString: "{:?}"
|
||||
example: "&Vec::new()"
|
||||
@ -893,10 +893,10 @@ paths:
|
||||
type: "array"
|
||||
items:
|
||||
type: "string"
|
||||
default: "$"
|
||||
enum:
|
||||
- ">"
|
||||
- "$"
|
||||
default: "$"
|
||||
formatString: "{:?}"
|
||||
example: "Some(&Vec::new())"
|
||||
- name: "enum_form_string"
|
||||
@ -918,10 +918,10 @@ paths:
|
||||
type: "array"
|
||||
items:
|
||||
type: "string"
|
||||
default: "$"
|
||||
enum:
|
||||
- ">"
|
||||
- "$"
|
||||
default: "$"
|
||||
formatString: "{:?}"
|
||||
example: "Some(&Vec::new())"
|
||||
- name: "enum_header_string"
|
||||
@ -943,10 +943,10 @@ paths:
|
||||
type: "array"
|
||||
items:
|
||||
type: "string"
|
||||
default: "$"
|
||||
enum:
|
||||
- ">"
|
||||
- "$"
|
||||
default: "$"
|
||||
formatString: "{:?}"
|
||||
example: "Some(&Vec::new())"
|
||||
- name: "enum_query_string"
|
||||
@ -1047,7 +1047,7 @@ paths:
|
||||
maximum: 543.2
|
||||
minimum: 32.1
|
||||
formatString: "{}"
|
||||
example: "3.4"
|
||||
example: "8.14"
|
||||
- name: "float"
|
||||
in: "formData"
|
||||
description: "None"
|
||||
@ -1089,8 +1089,8 @@ paths:
|
||||
required: true
|
||||
type: "string"
|
||||
format: "byte"
|
||||
formatString: "\\\"{:?}\\\""
|
||||
example: "swagger::ByteArray(\"byte_example\".to_string().into_bytes())"
|
||||
formatString: "{:?}"
|
||||
example: "swagger::ByteArray(Vec::from(\"B\"))"
|
||||
- name: "binary"
|
||||
in: "formData"
|
||||
description: "None"
|
||||
@ -1465,12 +1465,12 @@ definitions:
|
||||
type: "boolean"
|
||||
default: false
|
||||
example:
|
||||
petId: 6
|
||||
quantity: 1
|
||||
id: 0
|
||||
shipDate: "2000-01-23T04:56:07.000+00:00"
|
||||
petId: 6
|
||||
complete: false
|
||||
status: "placed"
|
||||
quantity: 1
|
||||
shipDate: "2000-01-23T04:56:07.000+00:00"
|
||||
xml:
|
||||
name: "Order"
|
||||
upperCaseName: "ORDER"
|
||||
@ -1483,8 +1483,8 @@ definitions:
|
||||
name:
|
||||
type: "string"
|
||||
example:
|
||||
name: "name"
|
||||
id: 6
|
||||
name: "name"
|
||||
xml:
|
||||
name: "Category"
|
||||
upperCaseName: "CATEGORY"
|
||||
@ -1512,14 +1512,14 @@ definitions:
|
||||
format: "int32"
|
||||
description: "User Status"
|
||||
example:
|
||||
firstName: "firstName"
|
||||
lastName: "lastName"
|
||||
password: "password"
|
||||
userStatus: 6
|
||||
phone: "phone"
|
||||
id: 0
|
||||
email: "email"
|
||||
lastName: "lastName"
|
||||
phone: "phone"
|
||||
username: "username"
|
||||
email: "email"
|
||||
userStatus: 6
|
||||
firstName: "firstName"
|
||||
password: "password"
|
||||
xml:
|
||||
name: "User"
|
||||
upperCaseName: "USER"
|
||||
@ -1532,8 +1532,8 @@ definitions:
|
||||
name:
|
||||
type: "string"
|
||||
example:
|
||||
name: "name"
|
||||
id: 1
|
||||
name: "name"
|
||||
xml:
|
||||
name: "Tag"
|
||||
upperCaseName: "TAG"
|
||||
@ -1574,20 +1574,20 @@ definitions:
|
||||
- "pending"
|
||||
- "sold"
|
||||
example:
|
||||
tags:
|
||||
- id: 1
|
||||
name: "name"
|
||||
- id: 1
|
||||
name: "name"
|
||||
id: 0
|
||||
category:
|
||||
id: 6
|
||||
name: "name"
|
||||
status: "available"
|
||||
name: "doggie"
|
||||
photoUrls:
|
||||
- "photoUrls"
|
||||
- "photoUrls"
|
||||
name: "doggie"
|
||||
id: 0
|
||||
category:
|
||||
name: "name"
|
||||
id: 6
|
||||
tags:
|
||||
- name: "name"
|
||||
id: 1
|
||||
- name: "name"
|
||||
id: 1
|
||||
status: "available"
|
||||
xml:
|
||||
name: "Pet"
|
||||
upperCaseName: "PET"
|
||||
@ -1602,9 +1602,9 @@ definitions:
|
||||
message:
|
||||
type: "string"
|
||||
example:
|
||||
message: "message"
|
||||
code: 0
|
||||
type: "type"
|
||||
message: "message"
|
||||
upperCaseName: "APIRESPONSE"
|
||||
$special[model.name]:
|
||||
properties:
|
||||
@ -1957,8 +1957,8 @@ definitions:
|
||||
my_boolean:
|
||||
$ref: "#/definitions/OuterBoolean"
|
||||
example:
|
||||
my_string: {}
|
||||
my_number: {}
|
||||
my_string: {}
|
||||
my_boolean: {}
|
||||
upperCaseName: "OUTERCOMPOSITE"
|
||||
OuterNumber:
|
||||
|
@ -129,7 +129,7 @@ fn main() {
|
||||
// },
|
||||
|
||||
Some("TestEndpointParameters") => {
|
||||
let result = client.test_endpoint_parameters(3.4, 1.2, "pattern_without_delimiter_example".to_string(), swagger::ByteArray("byte_example".to_string().into_bytes()), Some(56), Some(56), Some(789), Some(3.4), Some("string_example".to_string()), Some(swagger::ByteArray(Vec::from("B"))), None, None, Some("password_example".to_string()), Some("callback_example".to_string())).wait();
|
||||
let result = client.test_endpoint_parameters(8.14, 1.2, "pattern_without_delimiter_example".to_string(), swagger::ByteArray(Vec::from("B")), Some(56), Some(56), Some(789), Some(3.4), Some("string_example".to_string()), Some(swagger::ByteArray(Vec::from("B"))), None, None, Some("password_example".to_string()), Some("callback_example".to_string())).wait();
|
||||
println!("{:?} (X-Span-ID: {:?})", result, client.context().x_span_id.clone().unwrap_or(String::from("<none>")));
|
||||
},
|
||||
|
||||
|
@ -95,7 +95,7 @@ impl Api for Server {
|
||||
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
fn test_endpoint_parameters(&self, number: f64, double: f64, pattern_without_delimiter: String, byte: swagger::ByteArray, integer: Option<i32>, int32: Option<i32>, int64: Option<i64>, float: Option<f32>, string: Option<String>, binary: Option<swagger::ByteArray>, date: Option<chrono::DateTime<chrono::Utc>>, date_time: Option<chrono::DateTime<chrono::Utc>>, password: Option<String>, callback: Option<String>, context: &Context) -> Box<Future<Item=TestEndpointParametersResponse, Error=ApiError> + Send> {
|
||||
let context = context.clone();
|
||||
println!("test_endpoint_parameters({}, {}, \"{}\", \"{:?}\", {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}", number, double, pattern_without_delimiter, byte, integer, int32, int64, float, string, binary, date, date_time, password, callback, context.x_span_id.unwrap_or(String::from("<none>")).clone());
|
||||
println!("test_endpoint_parameters({}, {}, \"{}\", {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}", number, double, pattern_without_delimiter, byte, integer, int32, int64, float, string, binary, date, date_time, password, callback, context.x_span_id.unwrap_or(String::from("<none>")).clone());
|
||||
Box::new(futures::failed("Generic failure".into()))
|
||||
}
|
||||
|
||||
|
@ -535,10 +535,10 @@ fn add_routes<T>(router: &mut Router, api: T) where T: Api + Send + Sync + Clone
|
||||
|
||||
|
||||
// Form parameters
|
||||
let param_number = 3.4;
|
||||
let param_number = 8.14;
|
||||
let param_double = 1.2;
|
||||
let param_pattern_without_delimiter = "pattern_without_delimiter_example".to_string();
|
||||
let param_byte = swagger::ByteArray("byte_example".to_string().into_bytes());
|
||||
let param_byte = swagger::ByteArray(Vec::from("B"));
|
||||
let param_integer = Some(56);
|
||||
let param_int32 = Some(56);
|
||||
let param_int64 = Some(789);
|
||||
|
Loading…
x
Reference in New Issue
Block a user