Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
92 changes: 50 additions & 42 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ members = [

# Ideally, we'd be able to use workspace dependencies, but that's only supported starting Rust 1.64,
# and our MSRV is Rust 1.60.

[patch.crates-io]
typify = { path = "../typify/typify" }

2 changes: 1 addition & 1 deletion crates/integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ schemars = { version = "0.8.17", optional = true }
serde = { version = "1", optional = true }
serde_json = { version = "1.0.115", optional = true }
syn = { version = "2.0.48", optional = true }
typify = { version = "0.0.15", optional = true }
typify = { version = "0.0.16", optional = true }

[features]
internal-schemars08-tests = [
Expand Down
50 changes: 38 additions & 12 deletions crates/integration-tests/outputs/schema-rust-with-replace.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,46 @@
/// Error types.
pub mod error {
/// Error from a TryFrom or FromStr implementation.
pub struct ConversionError(std::borrow::Cow<'static, str>);
impl std::error::Error for ConversionError {}
impl std::fmt::Display for ConversionError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
std::fmt::Display::fmt(&self.0, f)
}
}
impl std::fmt::Debug for ConversionError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
std::fmt::Debug::fmt(&self.0, f)
}
}
impl From<&'static str> for ConversionError {
fn from(value: &'static str) -> Self {
Self(value.into())
}
}
impl From<String> for ConversionError {
fn from(value: String) -> Self {
Self(value.into())
}
}
}
///MyPathStruct
///
/// <details><summary>JSON schema</summary>
///
/// ```json
/**{
"title": "MyPathStruct",
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"$ref": "#/definitions/TypedUuidForMyKind"
}
}
}*/
///{
/// "title": "MyPathStruct",
/// "type": "object",
/// "required": [
/// "id"
/// ],
/// "properties": {
/// "id": {
/// "$ref": "#/definitions/TypedUuidForMyKind"
/// }
/// }
///}
/// ```
/// </details>
#[derive(Clone, Debug, Deserialize, Serialize)]
Expand Down
Loading