Skip to content

Commit 895b6e1

Browse files
committed
chore: temp crate fork
1 parent 615a318 commit 895b6e1

File tree

280 files changed

+804
-804
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

280 files changed

+804
-804
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ jobs:
3131
cargo add --dev garde --git https://github.com/jprochazk/garde.git --rev be00ddddf8de14530ee890ccfdbaf0b13fb32852
3232
cargo add --dev validator@0.18.1
3333
cargo update url --precise 2.5.2
34-
working-directory: ./schemars
34+
working-directory: ./cog_schemars
3535
- uses: dtolnay/rust-toolchain@master
3636
with:
3737
toolchain: ${{ matrix.rust }}
3838
- name: Check with no feature flags
3939
run: cargo check --verbose --no-default-features
4040
continue-on-error: ${{ matrix.allow_failure }}
41-
working-directory: ./schemars
41+
working-directory: ./cog_schemars
4242
- name: Run tests
4343
run: cargo test --verbose --all-features --no-fail-fast
4444
continue-on-error: ${{ matrix.allow_failure }}
45-
working-directory: ./schemars
45+
working-directory: ./cog_schemars
4646
- name: Run derive tests
4747
run: cargo test --verbose --all-features --no-fail-fast
4848
continue-on-error: ${{ matrix.allow_failure }}
49-
working-directory: ./schemars_derive
49+
working-directory: ./cog_schemars_derive

CHANGELOG.md

Lines changed: 79 additions & 79 deletions
Large diffs are not rendered by default.

Cargo.lock

Lines changed: 42 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[workspace]
22
members = [
3-
"schemars",
4-
"schemars_derive"
3+
"cog_schemars",
4+
"cog_schemars_derive"
55
]
66
resolver = "2"

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
> [!NOTE]
44
> This branch is for the current v1 alpha version of Schemars which is still under development.
5-
> For the current stable release of Schemars (v0.8.x), see the [v0 branch](https://github.com/GREsau/schemars/tree/v0).
5+
> For the current stable release of Schemars (v0.8.x), see the [v0 branch](https://github.com/GREsau/cog_schemars/tree/v0).
66
>
7-
> For information on migrating from 0.8 to 1.0, see [the migration guide](https://graham.cool/schemars/migrating/).
7+
> For information on migrating from 0.8 to 1.0, see [the migration guide](https://graham.cool/cog_schemars/migrating/).
88
9-
[![CI Build](https://img.shields.io/github/actions/workflow/status/GREsau/schemars/ci.yml?branch=master&logo=GitHub)](https://github.com/GREsau/schemars/actions)
10-
[![Crates.io](https://img.shields.io/crates/v/schemars)](https://crates.io/crates/schemars)
11-
[![Docs](https://img.shields.io/docsrs/schemars/1.0.0--latest?label=docs)](https://docs.rs/schemars/1.0.0--latest)
9+
[![CI Build](https://img.shields.io/github/actions/workflow/status/GREsau/cog_schemars/ci.yml?branch=master&logo=GitHub)](https://github.com/GREsau/cog_schemars/actions)
10+
[![Crates.io](https://img.shields.io/crates/v/cog_schemars)](https://crates.io/crates/cog_schemars)
11+
[![Docs](https://img.shields.io/docsrs/cog_schemars/1.0.0--latest?label=docs)](https://docs.rs/cog_schemars/1.0.0--latest)
1212
[![MSRV 1.70+](https://img.shields.io/badge/msrv-1.70-blue)](https://blog.rust-lang.org/2023/06/01/Rust-1.70.0.html)
1313

1414
Generate JSON Schema documents from Rust code
@@ -18,7 +18,7 @@ Generate JSON Schema documents from Rust code
1818
If you don't really care about the specifics, the easiest way to generate a JSON schema for your types is to `#[derive(JsonSchema)]` and use the `schema_for!` macro. All fields of the type must also implement `JsonSchema` - Schemars implements this for many standard library types.
1919

2020
```rust
21-
use schemars::{schema_for, JsonSchema};
21+
use cog_schemars::{schema_for, JsonSchema};
2222

2323
#[derive(JsonSchema)]
2424
pub struct MyStruct {
@@ -111,7 +111,7 @@ println!("{}", serde_json::to_string_pretty(&schema).unwrap());
111111
One of the main aims of this library is compatibility with [Serde](https://github.com/serde-rs/serde). Any generated schema _should_ match how [serde_json](https://github.com/serde-rs/json) would serialize/deserialize to/from JSON. To support this, Schemars will check for any `#[serde(...)]` attributes on types that derive `JsonSchema`, and adjust the generated schema accordingly.
112112

113113
```rust
114-
use schemars::{schema_for, JsonSchema};
114+
use cog_schemars::{schema_for, JsonSchema};
115115
use serde::{Deserialize, Serialize};
116116

117117
#[derive(Deserialize, Serialize, JsonSchema)]
@@ -192,14 +192,14 @@ println!("{}", serde_json::to_string_pretty(&schema).unwrap());
192192

193193
</details>
194194

195-
`#[serde(...)]` attributes can be overriden using `#[schemars(...)]` attributes, which behave identically (e.g. `#[schemars(rename_all = "camelCase")]`). You may find this useful if you want to change the generated schema without affecting Serde's behaviour, or if you're just not using Serde.
195+
`#[serde(...)]` attributes can be overriden using `#[cog_schemars(...)]` attributes, which behave identically (e.g. `#[cog_schemars(rename_all = "camelCase")]`). You may find this useful if you want to change the generated schema without affecting Serde's behaviour, or if you're just not using Serde.
196196

197197
### Schema from Example Value
198198

199-
If you want a schema for a type that can't/doesn't implement `JsonSchema`, but does implement `serde::Serialize`, then you can generate a JSON schema from a value of that type. However, this schema will generally be less precise than if the type implemented `JsonSchema` - particularly when it involves enums, since schemars will not make any assumptions about the structure of an enum based on a single variant.
199+
If you want a schema for a type that can't/doesn't implement `JsonSchema`, but does implement `serde::Serialize`, then you can generate a JSON schema from a value of that type. However, this schema will generally be less precise than if the type implemented `JsonSchema` - particularly when it involves enums, since cog_schemars will not make any assumptions about the structure of an enum based on a single variant.
200200

201201
```rust
202-
use schemars::schema_for_value;
202+
use cog_schemars::schema_for_value;
203203
use serde::Serialize;
204204

205205
#[derive(Serialize)]
@@ -256,7 +256,7 @@ println!("{}", serde_json::to_string_pretty(&schema).unwrap());
256256

257257
## Feature Flags
258258

259-
- `std` (enabled by default) - implements `JsonSchema` for types in the rust standard library (`JsonSchema` is still implemented on types in `core` and `alloc`, even when this feature is disabled). Disable this feature to use schemars in `no_std` environments.
259+
- `std` (enabled by default) - implements `JsonSchema` for types in the rust standard library (`JsonSchema` is still implemented on types in `core` and `alloc`, even when this feature is disabled). Disable this feature to use cog_schemars in `no_std` environments.
260260
- `derive` (enabled by default) - provides `#[derive(JsonSchema)]` macro
261261
- `preserve_order` - keep the order of struct fields in `Schema` properties
262262
- `raw_value` - implements `JsonSchema` for `serde_json::value::RawValue` (enables the serde_json `raw_value` feature)
@@ -276,9 +276,9 @@ Schemars can implement `JsonSchema` on types from several popular crates, enable
276276
- `url2` - [url](https://crates.io/crates/url) (^2.0)
277277
- `uuid1` - [uuid](https://crates.io/crates/uuid) (^1.0)
278278

279-
For example, to implement `JsonSchema` on types from `chrono`, enable it as a feature in the `schemars` dependency in your `Cargo.toml` like so:
279+
For example, to implement `JsonSchema` on types from `chrono`, enable it as a feature in the `cog_schemars` dependency in your `Cargo.toml` like so:
280280

281281
```toml
282282
[dependencies]
283-
schemars = { version = "1.0.0-alpha.17", features = ["chrono04"] }
283+
cog_schemars = { version = "1.0.0-alpha.17", features = ["chrono04"] }
284284
```
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
2-
name = "schemars"
2+
name = "cog_schemars"
33
description = "Generate JSON Schemas from Rust code"
4-
homepage = "https://graham.cool/schemars/"
5-
repository = "https://github.com/GREsau/schemars"
4+
homepage = "https://graham.cool/cog_schemars/"
5+
repository = "https://github.com/GREsau/cog_schemars"
66
version = "1.0.0-alpha.17"
77
authors = ["Graham Esau <gesau@hotmail.co.uk>"]
88
edition = "2021"
@@ -13,7 +13,7 @@ categories = ["encoding", "no-std"]
1313
rust-version = "1.70"
1414

1515
[dependencies]
16-
schemars_derive = { version = "=1.0.0-alpha.17", optional = true, path = "../schemars_derive" }
16+
cog_schemars_derive = { version = "=1.0.0-alpha.17", optional = true, path = "../cog_schemars_derive" }
1717
serde = { version = "1.0", default-features = false, features = ["alloc"]}
1818
serde_json = { version = "1.0.127", default-features = false, features = ["alloc"] }
1919
dyn-clone = "1.0"
@@ -65,7 +65,7 @@ default = ["derive", "std"]
6565
std = []
6666

6767
# Provide `derive(JsonSchema)` macro.
68-
derive = ["schemars_derive"]
68+
derive = ["cog_schemars_derive"]
6969

7070
# Preserves order of properties inserted into a `Schema`.
7171
# When deriving `JsonSchema`, this ensures that the `properties` entires match
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)