Skip to content

Commit

Permalink
chore: convert to workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Oct 9, 2024
1 parent 152446e commit 427781e
Show file tree
Hide file tree
Showing 51 changed files with 99 additions and 84 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
.toolchain

# Rust
target
/target
Cargo.lock
!/Cargo.lock
53 changes: 6 additions & 47 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,55 +1,14 @@
[package]
name = "oas3"
description = "Structures and tools to parse, navigate, and validate OpenAPI v3.1 specifications"
version = "0.11.0"
authors = ["softprops <[email protected]>", "Rob Ede <[email protected]>"]
keywords = ["oas3", "openapi", "swagger", "api", "validation"]
categories = ["data-structures", "development-tools::testing", "parsing"]
[workspace]
resolver = "2"
members = ["crates/*"]

[workspace.package]
repository = "https://github.com/x52dev/oas3-rs"
license = "MIT"
edition = "2021"
rust-version = "1.75"

[features]
default = ["validation"]
validation = []
conformance = ["validation", "reqwest", "prettytable-rs", "colored"]

[dependencies]
bytes = "1.7"
derive_more = { version = "1", features = ["display", "error", "from"] }
futures-util = "0.3"
http = "1"
log = "0.4"
once_cell = "1"
regex = "1.11.0"
semver = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_yml = "0.0.12"
url = { version = "2", features = ["serde"] }

# conformance
colored = { version = "2", optional = true }
prettytable-rs = { version = "0.10", optional = true }
reqwest = { version = "0.12", optional = true, features = ["json"] }

[dev-dependencies]
assert_matches = "1"
color-eyre = "0.6"
dotenvy = "0.15"
eyre = "0.6.12"
indoc = "2"
maplit = "1"
pretty_assertions = "1"
pretty_env_logger = "0.5"
tokio = { version = "1.40.0", features = ["full"] }

[[example]]
name = "conformance"
required-features = ["conformance"]

[lints.rust]
[workspace.lints.rust]
rust_2018_idioms = "deny"
nonstandard_style = "deny"
future_incompatible = "deny"
Expand Down
35 changes: 0 additions & 35 deletions README.md

This file was deleted.

1 change: 1 addition & 0 deletions README.md
53 changes: 53 additions & 0 deletions crates/oas3/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[package]
name = "oas3"
description = "Structures and tools to parse, navigate, and validate OpenAPI v3.1 specifications"
version = "0.11.0"
authors = ["softprops <[email protected]>", "Rob Ede <[email protected]>"]
keywords = ["oas3", "openapi", "swagger", "api", "validation"]
categories = ["data-structures", "development-tools::testing", "parsing"]
repository = { workspace = true }
license = { workspace = true }
edition = { workspace = true }
rust-version = { workspace = true }

[features]
default = ["validation"]
validation = []
conformance = ["validation", "reqwest", "prettytable-rs", "colored"]

[dependencies]
bytes = "1.7"
derive_more = { version = "1", features = ["display", "error", "from"] }
futures-util = "0.3"
http = "1"
log = "0.4"
once_cell = "1"
regex = "1.11.0"
semver = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_yml = "0.0.12"
url = { version = "2", features = ["serde"] }

# conformance
colored = { version = "2", optional = true }
prettytable-rs = { version = "0.10", optional = true }
reqwest = { version = "0.12", optional = true, features = ["json"] }

[dev-dependencies]
assert_matches = "1"
color-eyre = "0.6"
dotenvy = "0.15"
eyre = "0.6.12"
indoc = "2"
maplit = "1"
pretty_assertions = "1"
pretty_env_logger = "0.5"
tokio = { version = "1.40.0", features = ["full"] }

[[example]]
name = "conformance"
required-features = ["conformance"]

[lints]
workspace = true
35 changes: 35 additions & 0 deletions crates/oas3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# OAS3

<!-- prettier-ignore-start -->

[![crates.io](https://img.shields.io/crates/v/oas3?label=latest)](https://crates.io/crates/oas3)
[![Documentation](https://docs.rs/oas3/badge.svg?version=0.11.0)](https://docs.rs/oas3/0.11.0)
[![dependency status](https://deps.rs/crate/oas3/0.11.0/status.svg)](https://deps.rs/crate/oas3/0.11.0)
![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/oas3.svg)
<br />
[![CI](https://github.com/x52dev/oas3/actions/workflows/ci.yml/badge.svg)](https://github.com/x52dev/oas3/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/x52dev/oas3/branch/main/graph/badge.svg)](https://codecov.io/gh/x52dev/oas3)
![Version](https://img.shields.io/crates/msrv/oas3.svg)
[![Download](https://img.shields.io/crates/d/oas3.svg)](https://crates.io/crates/oas3)

<!-- prettier-ignore-end -->

<!-- cargo-rdme start -->

Structures and tools to parse, navigate and validate [OpenAPI v3.1] specifications.

Note that due to v3.1 being a breaking change from v3.0, you may have trouble correctly parsing
specs in the older format.

## Example

```rust
match oas3::from_path("path/to/openapi.yml") {
Ok(spec) => println!("spec: {:?}", spec),
Err(err) => println!("error: {}", err)
}
```

[OpenAPI v3.1]: https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md

<!-- cargo-rdme end -->
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fmt: update-readmes
# Update READMEs from crate root documentation.
[group("lint")]
update-readmes:
cargo rdme --force
cd crates/oas3 && cargo rdme --force

# Lint workspace with Clippy.
[group("lint")]
Expand Down

0 comments on commit 427781e

Please sign in to comment.