Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/target_rust/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.49
FROM rust:1.67

ARG MAIN

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ pub enum Root {
pub struct RootBar {
#[serde(rename = "baz")]
#[serde(skip_serializing_if = "Option::is_none")]
pub baz: Option<Box<Vec<String>>>,
pub baz: Option<Vec<String>>,

#[serde(rename = "quux")]
#[serde(skip_serializing_if = "Option::is_none")]
pub quux: Option<Box<bool>>,
pub quux: Option<bool>,
}
20 changes: 10 additions & 10 deletions crates/target_rust/output/geojson/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::collections::HashMap;

pub type Root = GeojsonObject;
pub type Root = Box<GeojsonObject>;

/// A GeoJSON object MAY have a member named "bbox" to include information
/// on the coordinate range for its Geometries, Features, or
Expand Down Expand Up @@ -165,7 +165,7 @@ pub struct GeojsonObjectFeature {
#[derive(Serialize, Deserialize)]
pub struct GeojsonObjectFeatureCollection {
#[serde(rename = "features")]
pub features: Vec<GeojsonObject>,
pub features: Vec<Box<GeojsonObject>>,
}

/// A GeoJSON object with type "GeometryCollection" is a Geometry
Expand Down Expand Up @@ -198,11 +198,11 @@ pub struct GeojsonObjectFeatureCollection {
#[derive(Serialize, Deserialize)]
pub struct GeojsonObjectGeometryCollection {
#[serde(rename = "geometries")]
pub geometries: Vec<GeojsonObject>,
pub geometries: Vec<Box<GeojsonObject>>,

#[serde(rename = "bbox")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bbox: Option<Box<BoundingBox>>,
pub bbox: Option<BoundingBox>,
}

/// For type "LineString", the "coordinates" member is an array of two
Expand All @@ -214,7 +214,7 @@ pub struct GeojsonObjectLineString {

#[serde(rename = "bbox")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bbox: Option<Box<BoundingBox>>,
pub bbox: Option<BoundingBox>,
}

/// For type "MultiLineString", the "coordinates" member is an array of
Expand All @@ -226,7 +226,7 @@ pub struct GeojsonObjectMultiLineString {

#[serde(rename = "bbox")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bbox: Option<Box<BoundingBox>>,
pub bbox: Option<BoundingBox>,
}

/// For type "MultiPoint", the "coordinates" member is an array of
Expand All @@ -238,7 +238,7 @@ pub struct GeojsonObjectMultiPoint {

#[serde(rename = "bbox")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bbox: Option<Box<BoundingBox>>,
pub bbox: Option<BoundingBox>,
}

/// For type "MultiPolygon", the "coordinates" member is an array of
Expand All @@ -250,7 +250,7 @@ pub struct GeojsonObjectMultiPolygon {

#[serde(rename = "bbox")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bbox: Option<Box<BoundingBox>>,
pub bbox: Option<BoundingBox>,
}

/// For type "Point", the "coordinates" member is a single position.
Expand All @@ -261,7 +261,7 @@ pub struct GeojsonObjectPoint {

#[serde(rename = "bbox")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bbox: Option<Box<BoundingBox>>,
pub bbox: Option<BoundingBox>,
}

/// For type "Polygon", the "coordinates" member MUST be an array of
Expand All @@ -273,7 +273,7 @@ pub struct GeojsonObjectPolygon {

#[serde(rename = "bbox")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bbox: Option<Box<BoundingBox>>,
pub bbox: Option<BoundingBox>,
}

/// To specify a constraint specific to Polygons, it is useful to
Expand Down
2 changes: 1 addition & 1 deletion crates/target_rust/output/nullable_discriminator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ pub struct RootQuux {
pub quuz: String,
}

pub type Root = Option<Box<Root0>>;
pub type Root = Option<Root0>;
2 changes: 1 addition & 1 deletion crates/target_rust/output/nullable_elements/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Code generated by jtd-codegen for Rust v0.2.1

pub type Root = Option<Box<Vec<String>>>;
pub type Root = Option<Vec<String>>;
2 changes: 1 addition & 1 deletion crates/target_rust/output/nullable_enum/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ pub enum Root0 {
Foo,
}

pub type Root = Option<Box<Root0>>;
pub type Root = Option<Root0>;
2 changes: 1 addition & 1 deletion crates/target_rust/output/nullable_properties/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ pub struct Root0 {
pub quux: Vec<bool>,
}

pub type Root = Option<Box<Root0>>;
pub type Root = Option<Root0>;
6 changes: 3 additions & 3 deletions crates/target_rust/output/nullable_references/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ pub type NotnullRefNullString = NullString;

pub type NotnullString = String;

pub type NullRefNotnullString = Option<Box<NotnullString>>;
pub type NullRefNotnullString = Option<NotnullString>;

pub type NullRefNullString = Option<Box<NullString>>;
pub type NullRefNullString = Option<NullString>;

pub type NullString = Option<Box<String>>;
pub type NullString = Option<String>;
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
pub struct Root {
#[serde(rename = "foo")]
pub foo: Option<Box<DateTime<FixedOffset>>>,
pub foo: Option<DateTime<FixedOffset>>,
}
6 changes: 3 additions & 3 deletions crates/target_rust/output/optional_properties/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ use serde::{Deserialize, Serialize};
pub struct Root {
#[serde(rename = "bar")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bar: Option<Box<Vec<String>>>,
pub bar: Option<Vec<String>>,

#[serde(rename = "baz")]
#[serde(skip_serializing_if = "Option::is_none")]
pub baz: Option<Box<bool>>,
pub baz: Option<bool>,

#[serde(rename = "foo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub foo: Option<Box<String>>,
pub foo: Option<String>,
}
2 changes: 1 addition & 1 deletion crates/target_rust/output/root_nullable_string/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Code generated by jtd-codegen for Rust v0.2.1

pub type Root = Option<Box<String>>;
pub type Root = Option<String>;
2 changes: 1 addition & 1 deletion crates/target_rust/output/root_nullable_timestamp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

use chrono::{DateTime, FixedOffset};

pub type Root = Option<Box<DateTime<FixedOffset>>>;
pub type Root = Option<DateTime<FixedOffset>>;