mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-09 14:26:11 +00:00
Better Rust client imports (#3332)
* Better Rust client imports. * No more "unused_imports" in models for serde_json::Value. * No more compilation problem for apis requiring serde_json::Value. * "crate::" prefix for models and apis imports, for compatibility with Rust 2018 edition. * Rust samples regeneration using new code.
This commit is contained in:
committed by
Benjamin Gill
parent
0fec25e92e
commit
26b8d1f4c2
@@ -10,9 +10,6 @@
|
||||
|
||||
/// ApiResponse : Describes the result of uploading an image resource
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use serde_json::Value;
|
||||
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct ApiResponse {
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
|
||||
/// Category : A category for a pet
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use serde_json::Value;
|
||||
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct Category {
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
|
||||
/// Order : An order for a pets from the pet store
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use serde_json::Value;
|
||||
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct Order {
|
||||
|
||||
@@ -10,22 +10,19 @@
|
||||
|
||||
/// Pet : A pet for sale in the pet store
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use serde_json::Value;
|
||||
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct Pet {
|
||||
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
|
||||
pub id: Option<i64>,
|
||||
#[serde(rename = "category", skip_serializing_if = "Option::is_none")]
|
||||
pub category: Option<::models::Category>,
|
||||
pub category: Option<crate::models::Category>,
|
||||
#[serde(rename = "name")]
|
||||
pub name: String,
|
||||
#[serde(rename = "photoUrls")]
|
||||
pub photo_urls: Vec<String>,
|
||||
#[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
|
||||
pub tags: Option<Vec<::models::Tag>>,
|
||||
pub tags: Option<Vec<crate::models::Tag>>,
|
||||
/// pet status in the store
|
||||
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
|
||||
pub status: Option<String>,
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
|
||||
/// Tag : A tag for a pet
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use serde_json::Value;
|
||||
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct Tag {
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
|
||||
/// User : A User who is purchasing from the pet store
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use serde_json::Value;
|
||||
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct User {
|
||||
|
||||
Reference in New Issue
Block a user