Skip to content

Commit

Permalink
Bump schemars to 1.0.0-alpha.15. Switch to proc-macro-error2
Browse files Browse the repository at this point in the history
  • Loading branch information
rlebran committed Sep 6, 2024
1 parent f4ab9d7 commit 57d6ff9
Show file tree
Hide file tree
Showing 34 changed files with 54 additions and 54 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ documentation = "https://docs.rs/apistos/"
license = "MIT OR Apache-2.0"
rust-version = "1.77"
publish = true
version = "1.0.0-pre-release.5"
version = "1.0.0-pre-release.6"

[workspace.dependencies]
actix-service = "2"
Expand All @@ -39,10 +39,10 @@ md5 = "0.7.0"
once_cell = "1"
pin-project = "1"
proc-macro2 = "1.0"
proc-macro-error = "1.0"
proc-macro-error2 = "2.0"
quote = "1.0"
regex = ">=1.5.5"
schemars = { version = "1.0.0-alpha.14", features = ["chrono04", "uuid1", "url2", "rust_decimal1"] }
schemars = { version = "1.0.0-alpha.15", features = ["chrono04", "uuid1", "url2", "rust_decimal1"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
syn = "2.0"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ carpenters, craftsmen, metallurgy ... which can also be considered by some as th
```toml
[dependencies]
schemars = "1.0.0-alpha.14"
apistos = "1.0.0-pre-release.5"
apistos = "1.0.0-pre-release.6"
```

### Usage example
Expand Down
2 changes: 1 addition & 1 deletion apistos-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ serde_qs = { workspace = true, features = ["actix4"], optional = true }
uuid = { workspace = true, optional = true }
url = { workspace = true, optional = true }

apistos-models = { path = "../apistos-models", version = "1.0.0-pre-release.5", features = ["deserialize"] }
apistos-models = { path = "../apistos-models", version = "1.0.0-pre-release.6", features = ["deserialize"] }

[dev-dependencies]
assert-json-diff = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions apistos-gen-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ assert-json-diff = { workspace = true }
chrono = { workspace = true, features = ["serde"] }
futures-core = { workspace = true }
apistos = { path = "../apistos", features = ["multipart", "uuid"] }
apistos-core = { path = "../apistos-core", version = "1.0.0-pre-release.5", features = ["actix-web-grants"] }
apistos-gen = { path = "../apistos-gen", version = "1.0.0-pre-release.5" }
apistos-core = { path = "../apistos-core", version = "1.0.0-pre-release.6", features = ["actix-web-grants"] }
apistos-gen = { path = "../apistos-gen", version = "1.0.0-pre-release.6" }
# we use the "preserve_order" feature from schemars here following https://github.com/netwo-io/apistos/pull/78
schemars = { workspace = true, features = ["preserve_order"] }
serde = { workspace = true, features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion apistos-gen-test/src/tests/api_callback_oas_3_0.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use actix_web::web::Json;
use assert_json_diff::assert_json_eq;
use schemars::_serde_json::json;
use schemars::_private::serde_json::json;
use serde::{Deserialize, Serialize};

use apistos::{JsonSchema, OpenApiVersion};
Expand Down
2 changes: 1 addition & 1 deletion apistos-gen-test/src/tests/api_callback_oas_3_1.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use actix_web::web::Json;
use assert_json_diff::assert_json_eq;
use schemars::_serde_json::json;
use schemars::_private::serde_json::json;
use serde::{Deserialize, Serialize};

use apistos::{JsonSchema, OpenApiVersion};
Expand Down
2 changes: 1 addition & 1 deletion apistos-gen-test/src/tests/api_operation_oas_3_0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use actix_web::http::header::ContentType;
use actix_web::web::Json;
use actix_web::{Error, HttpResponse, Responder};
use assert_json_diff::assert_json_eq;
use schemars::_serde_json::json;
use schemars::_private::serde_json::json;
use std::collections::HashSet;
use uuid::Uuid;

Expand Down
2 changes: 1 addition & 1 deletion apistos-gen-test/src/tests/api_operation_oas_3_1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use actix_web::http::header::ContentType;
use actix_web::web::Json;
use actix_web::{Error, HttpResponse, Responder};
use assert_json_diff::assert_json_eq;
use schemars::_serde_json::json;
use schemars::_private::serde_json::json;
use std::collections::HashSet;
use uuid::Uuid;

Expand Down
2 changes: 1 addition & 1 deletion apistos-gen-test/src/tests/api_webhook_oas_3_0.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use assert_json_diff::assert_json_eq;
use schemars::_serde_json::json;
use schemars::_private::serde_json::json;

use apistos::{ApiWebhook, OpenApiVersion};
use apistos_gen::ApiWebhookComponent;
Expand Down
2 changes: 1 addition & 1 deletion apistos-gen-test/src/tests/api_webhook_oas_3_1.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use actix_web::web::Json;
use assert_json_diff::assert_json_eq;
use schemars::_serde_json::json;
use schemars::_private::serde_json::json;

use crate::tests::api_webhook_oas_3_1::test_models::Test;
use apistos::{ApiWebhook, OpenApiVersion};
Expand Down
2 changes: 1 addition & 1 deletion apistos-gen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ actix-web = { workspace = true }
convert_case = { workspace = true }
darling = { workspace = true }
proc-macro2 = { workspace = true }
proc-macro-error = { workspace = true }
proc-macro-error2 = { workspace = true }
quote = { workspace = true }
syn = { workspace = true, features = ["full", "extra-traits"] }

Expand Down
2 changes: 1 addition & 1 deletion apistos-gen/src/callback_attr.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use darling::ast::NestedMeta;
use darling::FromMeta;
use proc_macro2::{Span, TokenStream};
use proc_macro_error::abort;
use proc_macro_error2::abort;
use quote::{quote, ToTokens};
use syn::Type;

Expand Down
2 changes: 1 addition & 1 deletion apistos-gen/src/internal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::internal::components::Components;
use crate::internal::operation::Operation;
use crate::operation_attr::OperationAttr;
use proc_macro2::{Span, TokenStream as TokenStream2};
use proc_macro_error::{abort, emit_error};
use proc_macro_error2::{abort, emit_error};
use quote::quote;

use syn::{
Expand Down
10 changes: 5 additions & 5 deletions apistos-gen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use darling::ast::NestedMeta;
use darling::Error;
use proc_macro::TokenStream;
use proc_macro2::Span;
use proc_macro_error::{abort, proc_macro_error, OptionExt};
use proc_macro_error2::{abort, proc_macro_error, OptionExt};
use quote::{format_ident, quote};
use syn::{DeriveInput, GenericParam, Ident, ItemFn};

Expand Down Expand Up @@ -122,11 +122,11 @@ pub fn derive_api_type(input: TokenStream) -> TokenStream {
fn json_schema(_gen: &mut schemars::gen::SchemaGenerator) -> apistos::Schema {
let instance_type = <Self as TypedSchema>::schema_type();
match <Self as TypedSchema>::format() {
Some(format) => apistos::Schema::try_from(schemars::_serde_json::json!({
Some(format) => apistos::Schema::try_from(schemars::_private::serde_json::json!({
"type": instance_type,
"format": format,
})),
None => apistos::Schema::try_from(schemars::_serde_json::json!({
None => apistos::Schema::try_from(schemars::_private::serde_json::json!({
"type": instance_type,
}))
}
Expand All @@ -148,11 +148,11 @@ pub fn derive_api_type(input: TokenStream) -> TokenStream {
Some((
#component_name.to_string(),
apistos::Schema::try_from(match <#ident #ty_generics>::format() {
Some(format) => schemars::_serde_json::json!({
Some(format) => schemars::_private::serde_json::json!({
"type": <#ident #ty_generics>::schema_type(),
"format": format,
}),
None => schemars::_serde_json::json!({
None => schemars::_private::serde_json::json!({
"type": <#ident #ty_generics>::schema_type(),
}),
})
Expand Down
2 changes: 1 addition & 1 deletion apistos-gen/src/openapi_cookie_attr.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::internal::schemas::Schemas;
use darling::FromMeta;
use proc_macro2::{Span, TokenStream};
use proc_macro_error::abort;
use proc_macro_error2::abort;
use quote::{quote, ToTokens};
use syn::Attribute;

Expand Down
2 changes: 1 addition & 1 deletion apistos-gen/src/openapi_error_attr.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use actix_web::http::StatusCode;
use darling::FromMeta;
use proc_macro2::{Span, TokenStream};
use proc_macro_error::abort;
use proc_macro_error2::abort;
use quote::{quote, ToTokens};
use syn::Attribute;

Expand Down
2 changes: 1 addition & 1 deletion apistos-gen/src/openapi_header_attr.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use darling::FromMeta;
use proc_macro2::{Span, TokenStream};
use proc_macro_error::abort;
use proc_macro_error2::abort;
use quote::{quote, ToTokens};
use syn::Attribute;

Expand Down
2 changes: 1 addition & 1 deletion apistos-gen/src/openapi_security_attr.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::internal::security::models::{ApiKey, Http, OAuth2, OpenIdConnect};
use darling::FromMeta;
use proc_macro2::{Span, TokenStream};
use proc_macro_error::abort;
use proc_macro_error2::abort;
use quote::{quote, ToTokens};
use syn::Attribute;

Expand Down
2 changes: 1 addition & 1 deletion apistos-gen/src/openapi_type_attr.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use darling::FromMeta;
use proc_macro2::{Ident, Span, TokenStream};
use proc_macro_error::abort;
use proc_macro_error2::abort;
use quote::{quote, ToTokens};
use syn::{Attribute, ImplGenerics, TypeGenerics, WhereClause};

Expand Down
2 changes: 1 addition & 1 deletion apistos-gen/src/operation_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::OPENAPI_CALLBACK_STRUCT_PREFIX;
use darling::ast::NestedMeta;
use darling::FromMeta;
use proc_macro2::{Ident, Span, TokenStream};
use proc_macro_error::abort;
use proc_macro_error2::abort;
use quote::{quote, ToTokens};
use std::collections::BTreeMap;

Expand Down
2 changes: 1 addition & 1 deletion apistos-gen/src/webhook_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::collections::BTreeMap;

use darling::FromMeta;
use proc_macro2::{Ident, Span, TokenStream};
use proc_macro_error::{abort, OptionExt};
use proc_macro_error2::{abort, OptionExt};
use quote::{quote, ToTokens};
use syn::{Attribute, Data, DataEnum, Error};

Expand Down
2 changes: 1 addition & 1 deletion apistos-models/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ These models are not linked to any web framework.
```toml
[dependencies]
schemars = "1.0.0-alpha.14"
apistos-models = "1.0.0-pre-release.5"
apistos-models = "1.0.0-pre-release.6"
```

### About us
Expand Down
2 changes: 1 addition & 1 deletion apistos-rapidoc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rust-version.workspace = true
license.workspace = true

[dependencies]
apistos-plugins = { path = "../apistos-plugins", version = "1.0.0-pre-release.5" }
apistos-plugins = { path = "../apistos-plugins", version = "1.0.0-pre-release.6" }

[lints]
workspace = true
2 changes: 1 addition & 1 deletion apistos-rapidoc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This crate is exposed through Apistos `rapidoc` feature.
```toml
[dependencies]
schemars = "1.0.0-alpha.14"
apistos = { version = "1.0.0-pre-release.5", feature = ["rapidoc"] }
apistos = { version = "1.0.0-pre-release.6", feature = ["rapidoc"] }
```

### About us
Expand Down
2 changes: 1 addition & 1 deletion apistos-redoc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rust-version.workspace = true
license.workspace = true

[dependencies]
apistos-plugins = { path = "../apistos-plugins", version = "1.0.0-pre-release.5" }
apistos-plugins = { path = "../apistos-plugins", version = "1.0.0-pre-release.6" }

[lints]
workspace = true
2 changes: 1 addition & 1 deletion apistos-redoc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This crate is exposed through Apistos `redoc` feature.
```toml
[dependencies]
schemars = "1.0.0-alpha.14"
apistos = { version = "1.0.0-pre-release.5", feature = ["redoc"] }
apistos = { version = "1.0.0-pre-release.6", feature = ["redoc"] }
```

### About us
Expand Down
2 changes: 1 addition & 1 deletion apistos-scalar/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rust-version.workspace = true
license.workspace = true

[dependencies]
apistos-plugins = { path = "../apistos-plugins", version = "1.0.0-pre-release.5" }
apistos-plugins = { path = "../apistos-plugins", version = "1.0.0-pre-release.6" }

[lints]
workspace = true
2 changes: 1 addition & 1 deletion apistos-scalar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This crate is exposed through Apistos `scalar` feature.
```toml
[dependencies]
schemars = "1.0.0-alpha.14"
apistos = { version = "1.0.0-pre-release.5", feature = ["scalar"] }
apistos = { version = "1.0.0-pre-release.6", feature = ["scalar"] }
```

### About us
Expand Down
2 changes: 1 addition & 1 deletion apistos-shuttle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ actix-web = { workspace = true }
num_cpus = { workspace = true }
shuttle-runtime = { workspace = true }

apistos = { path = "../apistos", version = "1.0.0-pre-release.5" }
apistos = { path = "../apistos", version = "1.0.0-pre-release.6" }

[lints]
workspace = true
4 changes: 2 additions & 2 deletions apistos-shuttle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ This crate allows you to run an actix-web server documented with Apistos on [Shu
```toml
[dependencies]
schemars = "1.0.0-alpha.14"
apistos = { version = "1.0.0-pre-release.5" }
apistos-shuttle = { version = "1.0.0-pre-release.5" }
apistos = { version = "1.0.0-pre-release.6" }
apistos-shuttle = { version = "1.0.0-pre-release.6" }
```

### Example
Expand Down
2 changes: 1 addition & 1 deletion apistos-swagger-ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rust-version.workspace = true
license.workspace = true

[dependencies]
apistos-plugins = { path = "../apistos-plugins", version = "1.0.0-pre-release.5" }
apistos-plugins = { path = "../apistos-plugins", version = "1.0.0-pre-release.6" }

[lints]
workspace = true
2 changes: 1 addition & 1 deletion apistos-swagger-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This crate is exposed through Apistos `swagger-ui` feature.
```toml
[dependencies]
schemars = "1.0.0-alpha.14"
apistos = { version = "1.0.0-pre-release.5", feature = ["swagger-ui"] }
apistos = { version = "1.0.0-pre-release.6", feature = ["swagger-ui"] }
```

### About us
Expand Down
26 changes: 13 additions & 13 deletions apistos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,25 @@ regex = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }

apistos-core = { path = "../apistos-core", version = "1.0.0-pre-release.5" }
apistos-gen = { path = "../apistos-gen", version = "1.0.0-pre-release.5" }
apistos-models = { path = "../apistos-models", version = "1.0.0-pre-release.5" }
apistos-plugins = { path = "../apistos-plugins", version = "1.0.0-pre-release.5" }
apistos-rapidoc = { path = "../apistos-rapidoc", version = "1.0.0-pre-release.5", optional = true }
apistos-redoc = { path = "../apistos-redoc", version = "1.0.0-pre-release.5", optional = true }
apistos-scalar = { path = "../apistos-scalar", version = "1.0.0-pre-release.5", optional = true }
apistos-swagger-ui = { path = "../apistos-swagger-ui", version = "1.0.0-pre-release.5", optional = true }
apistos-core = { path = "../apistos-core", version = "1.0.0-pre-release.6" }
apistos-gen = { path = "../apistos-gen", version = "1.0.0-pre-release.6" }
apistos-models = { path = "../apistos-models", version = "1.0.0-pre-release.6" }
apistos-plugins = { path = "../apistos-plugins", version = "1.0.0-pre-release.6" }
apistos-rapidoc = { path = "../apistos-rapidoc", version = "1.0.0-pre-release.6", optional = true }
apistos-redoc = { path = "../apistos-redoc", version = "1.0.0-pre-release.6", optional = true }
apistos-scalar = { path = "../apistos-scalar", version = "1.0.0-pre-release.6", optional = true }
apistos-swagger-ui = { path = "../apistos-swagger-ui", version = "1.0.0-pre-release.6", optional = true }

[dev-dependencies]
actix-web-lab = { workspace = true }
garde-actix-web = { workspace = true }
schemars = { workspace = true }

apistos-models = { path = "../apistos-models", version = "1.0.0-pre-release.5", features = ["deserialize"] }
apistos-rapidoc = { path = "../apistos-rapidoc", version = "1.0.0-pre-release.5" }
apistos-redoc = { path = "../apistos-redoc", version = "1.0.0-pre-release.5" }
apistos-scalar = { path = "../apistos-scalar", version = "1.0.0-pre-release.5" }
apistos-swagger-ui = { path = "../apistos-swagger-ui", version = "1.0.0-pre-release.5" }
apistos-models = { path = "../apistos-models", version = "1.0.0-pre-release.6", features = ["deserialize"] }
apistos-rapidoc = { path = "../apistos-rapidoc", version = "1.0.0-pre-release.6" }
apistos-redoc = { path = "../apistos-redoc", version = "1.0.0-pre-release.6" }
apistos-scalar = { path = "../apistos-scalar", version = "1.0.0-pre-release.6" }
apistos-swagger-ui = { path = "../apistos-swagger-ui", version = "1.0.0-pre-release.6" }

[lints]
workspace = true
Expand Down
2 changes: 1 addition & 1 deletion apistos/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//! ```toml
//! [dependencies]
//! schemars = "1.0.0-alpha.14"
//! apistos = "1.0.0-pre-release.5"
//! apistos = "1.0.0-pre-release.6"
//! ```
//!
//! # Usage example
Expand Down

0 comments on commit 57d6ff9

Please sign in to comment.