Skip to content

Commit f80b2d3

Browse files
authored
Merge pull request #172 from Metaswitch/improve-docs
Improve documentation
2 parents a68eeac + 5913492 commit f80b2d3

File tree

3 files changed

+39
-2
lines changed

3 files changed

+39
-2
lines changed

Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "swagger"
33
version = "6.3.0"
44
authors = ["Metaswitch Networks Ltd"]
55
license = "Apache-2.0"
6-
description = "A set of common utilities for Rust code generated by swagger-codegen"
6+
description = "A set of common utilities for Rust code generated by OpenAPI Generator"
77
homepage = "https://github.com/Metaswitch/swagger-rs"
88
repository = "https://github.com/Metaswitch/swagger-rs"
99
readme = "README.md"
@@ -71,3 +71,7 @@ native-tls = { version = "0.2", optional = true }
7171
tokio = {version = "1.0", features = ["macros", "rt"]}
7272
bytes = "1.0"
7373
hyper = { version = "0.14", features = ["client", "http1", "tcp"] }
74+
75+
[package.metadata.docs.rs]
76+
# Enable all features, pending https://github.com/rust-lang/rust/issues/43781 being resolved.
77+
all-features = true

src/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ pub trait Push<T> {
168168
/// the empty context struct, and subsequent arguments are the types
169169
/// that can be stored in contexts built using these struct.
170170
///
171-
/// A cons list built using the generated context type will implement Has<T> and Pop<T>
171+
/// A cons list built using the generated context type will implement `Has<T>` and `Pop<T>`
172172
/// for each type T that appears in the list, provided that the list only
173173
/// contains the types that were passed to the macro invocation after the context
174174
/// type name.

src/lib.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,43 @@
11
//! Support crate for Swagger codegen.
2+
//!
3+
//! # Crate features
4+
//!
5+
//! Crate features exist to reduce the dependencies on the crate. Most features
6+
//! should be enabled by the generator when relevant.
7+
//!
8+
//! By default, the **serdejson** feature is enabled.
9+
//!
10+
//! ## Format support
11+
//!
12+
//! - **multipart_form** - Enable support for `multipart/form-data` as described in RFC 7578
13+
//! - **multipart_related** - Enable support for `multipart/related` as described in RFC 2387
14+
//! - **serdejson** - Enable JSON serialization/deserialization support using serde.
15+
//!
16+
//! ## Feature support
17+
//!
18+
//! - **serdevalid** - Enable support for JSON schema based validation
19+
//! - **conversion** - Enable support for Frunk-based conversion - in particular,
20+
//! [transmogrification](https://docs.rs/frunk/latest/frunk/#transmogrifying)
21+
//!
22+
//! ## Use case support
23+
//!
24+
//! - **client** - Enable support for providing an OpenAPI client
25+
//! - **server** - Enable support for providing an OpenAPI server
26+
//! - **http1** - Enable support for HTTP/1 based APIs - RFC 9112
27+
//! - **http2** - Enable support for HTTP/2 based APIs - RFC 9113
28+
//! - **tcp** - Enable support for HTTP over TCP
29+
//! - **tls** - Enable support for HTTP over TLS (HTTPS)
30+
//! - **uds** - Enable support for HTTP over UDS (Unix Domain Sockets)
31+
232
#![deny(
333
missing_docs,
434
missing_debug_implementations,
535
unused_extern_crates,
636
unused_qualifications
737
)]
38+
// Enable doc_auto_cfg, but only on doc builds
39+
// See https://github.com/rust-lang/rust/issues/43781 for details
40+
#![cfg_attr(doc, feature(doc_auto_cfg))]
841

942
use std::error;
1043
use std::fmt;

0 commit comments

Comments
 (0)