Skip to content

Commit

Permalink
docs: HTML spec is now authoritative
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Dec 29, 2024
1 parent bb40483 commit bf9eb29
Show file tree
Hide file tree
Showing 25 changed files with 90 additions and 90 deletions.
2 changes: 1 addition & 1 deletion crates/oas3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ match oas3::from_path("path/to/openapi.yml") {
}
```

[OpenAPI v3.1]: https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md
[OpenAPI v3.1]: https://spec.openapis.org/oas/v3.1.0

<!-- cargo-rdme end -->
4 changes: 2 additions & 2 deletions crates/oas3/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//! }
//! ```
//!
//! [OpenAPI v3.1]: https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md
//! [OpenAPI v3.1]: https://spec.openapis.org/oas/v3.1.0
#![warn(missing_docs)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
Expand All @@ -28,7 +28,7 @@ pub use self::{error::Error, spec::Spec};
///
/// Refer to the official [specification] for more information.
///
/// [specification]: https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md
/// [specification]: https://spec.openapis.org/oas/v3.1.0
pub type OpenApiV3Spec = spec::Spec;

/// Try deserializing an OpenAPI spec (YAML or JSON) from a file, giving the path.
Expand Down
4 changes: 2 additions & 2 deletions crates/oas3/src/spec/components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use super::{
/// All objects defined within the components object will have no effect on the API unless
/// they are explicitly referenced from properties outside the components object.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#components-object>.
/// See <https://spec.openapis.org/oas/v3.1.0#components-object>.
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
pub struct Components {
/// An object to hold reusable [Schema Objects](ObjectSchema).
Expand Down Expand Up @@ -71,7 +71,7 @@ pub struct Components {
///
/// Only "x-" prefixed keys are collected, and the prefix is stripped.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#specification-extensions>.
/// See <https://spec.openapis.org/oas/v3.1.0#specification-extensions>.
#[serde(flatten, with = "spec_extensions")]
pub extensions: BTreeMap<String, serde_json::Value>,
}
4 changes: 2 additions & 2 deletions crates/oas3/src/spec/contact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub struct InvalidEmail;

/// Contact information for the exposed API.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#contact-object>.
/// See <https://spec.openapis.org/oas/v3.1.0#contact-object>.
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
pub struct Contact {
/// Identifying name of the contact person/organization.
Expand All @@ -36,7 +36,7 @@ pub struct Contact {
///
/// Only "x-" prefixed keys are collected, and the prefix is stripped.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#specification-extensions>.
/// See <https://spec.openapis.org/oas/v3.1.0#specification-extensions>.
#[serde(flatten, with = "spec_extensions")]
pub extensions: BTreeMap<String, serde_json::Value>,
}
Expand Down
4 changes: 2 additions & 2 deletions crates/oas3/src/spec/discriminator.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Schema specification for [OpenAPI 3.1](https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md)
//! Schema specification for [OpenAPI 3.1](https://spec.openapis.org/oas/v3.1.0)
use std::collections::BTreeMap;

Expand All @@ -10,7 +10,7 @@ use serde::{Deserialize, Serialize};
/// The discriminator is a specific object in a schema which is used to inform the consumer of the
/// document of an alternative schema based on the value associated with it.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#discriminator-object>.
/// See <https://spec.openapis.org/oas/v3.1.0#discriminator-object>.
#[derive(Debug, Clone, PartialEq, Default, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Discriminator {
Expand Down
6 changes: 3 additions & 3 deletions crates/oas3/src/spec/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ pub struct Encoding {
pub headers: BTreeMap<String, ObjectOrReference<Header>>,

/// Describes how a specific property value will be serialized depending on its type.
/// See [Parameter Object](https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#parameter-object)
/// See [Parameter Object](https://spec.openapis.org/oas/v3.1.0#parameter-object)
/// for details on the
/// [`style`](https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#parameterStyle)
/// [`style`](https://spec.openapis.org/oas/v3.1.0#parameterStyle)
/// property. The behavior follows the same values as `query` parameters, including
/// default values. This property SHALL be ignored if the request body media type
/// is not `application/x-www-form-urlencoded`.
Expand All @@ -37,7 +37,7 @@ pub struct Encoding {
/// When this is true, property values of type `array` or `object` generate
/// separate parameters for each value of the array, or key-value-pair of the map.
/// For other types of properties this property has no effect. When
/// [`style`](https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#encodingStyle)
/// [`style`](https://spec.openapis.org/oas/v3.1.0#encodingStyle)
/// is `form`, the default value is `true`. For all other styles, the default value
/// is `false`. This property SHALL be ignored if the request body media type is
/// not `application/x-www-form-urlencoded`.
Expand Down
4 changes: 2 additions & 2 deletions crates/oas3/src/spec/example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use super::{spec_extensions, FromRef, Ref, RefError, RefType, Spec};
///
/// Will be validated against schema when used in conformance testing.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#example-object>.
/// See <https://spec.openapis.org/oas/v3.1.0#example-object>.
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
pub struct Example {
/// Short description for the example.
Expand Down Expand Up @@ -38,7 +38,7 @@ pub struct Example {
///
/// Only "x-" prefixed keys are collected, and the prefix is stripped.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#specification-extensions>.
/// See <https://spec.openapis.org/oas/v3.1.0#specification-extensions>.
#[serde(flatten, with = "spec_extensions")]
pub extensions: BTreeMap<String, serde_json::Value>,
}
Expand Down
4 changes: 2 additions & 2 deletions crates/oas3/src/spec/external_doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use super::spec_extensions;

/// Allows referencing an external resource for extended documentation.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#external-documentation-object>.
/// See <https://spec.openapis.org/oas/v3.1.0#external-documentation-object>.
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
pub struct ExternalDoc {
/// The URL for the target documentation.
Expand All @@ -22,7 +22,7 @@ pub struct ExternalDoc {
///
/// Only "x-" prefixed keys are collected, and the prefix is stripped.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#specification-extensions>.
/// See <https://spec.openapis.org/oas/v3.1.0#specification-extensions>.
#[serde(flatten, with = "spec_extensions")]
pub extensions: BTreeMap<String, serde_json::Value>,
}
20 changes: 10 additions & 10 deletions crates/oas3/src/spec/flows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use super::spec_extensions;

/// Allows configuration of the supported OAuth Flows.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#oauth-flows-object>.
/// See <https://spec.openapis.org/oas/v3.1.0#oauth-flows-object>.
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Flows {
Expand All @@ -31,14 +31,14 @@ pub struct Flows {
///
/// Only "x-" prefixed keys are collected, and the prefix is stripped.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#specification-extensions>.
/// See <https://spec.openapis.org/oas/v3.1.0#specification-extensions>.
#[serde(flatten, with = "spec_extensions")]
pub extensions: BTreeMap<String, serde_json::Value>,
}

/// Configuration details for a implicit OAuth Flow.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#oauth-flow-object>.
/// See <https://spec.openapis.org/oas/v3.1.0#oauth-flow-object>.
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct ImplicitFlow {
Expand All @@ -63,14 +63,14 @@ pub struct ImplicitFlow {
///
/// Only "x-" prefixed keys are collected, and the prefix is stripped.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#specification-extensions>.
/// See <https://spec.openapis.org/oas/v3.1.0#specification-extensions>.
#[serde(flatten, with = "spec_extensions")]
pub extensions: BTreeMap<String, serde_json::Value>,
}

/// Configuration details for a password OAuth Flow.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#oauth-flow-object>.
/// See <https://spec.openapis.org/oas/v3.1.0#oauth-flow-object>.
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct PasswordFlow {
Expand All @@ -94,7 +94,7 @@ pub struct PasswordFlow {

/// Configuration details for a client credentials OAuth Flow.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#oauth-flow-object>.
/// See <https://spec.openapis.org/oas/v3.1.0#oauth-flow-object>.
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct ClientCredentialsFlow {
Expand All @@ -118,7 +118,7 @@ pub struct ClientCredentialsFlow {

/// Configuration details for a authorization code OAuth Flow.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#oauth-flow-object>.
/// See <https://spec.openapis.org/oas/v3.1.0#oauth-flow-object>.
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct AuthorizationCodeFlow {
Expand Down Expand Up @@ -153,16 +153,16 @@ pub struct AuthorizationCodeFlow {
/// callback object is an expression, evaluated at runtime, that identifies a URL to use for the
/// callback operation.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#callback-object>.
/// See <https://spec.openapis.org/oas/v3.1.0#callback-object>.
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Default)]
pub struct Callback(
/// A Path Item Object used to define a callback request and expected responses.
serde_json::Value, // TODO: Add "Specification Extensions" https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#specificationExtensions}
serde_json::Value, // TODO: Add "Specification Extensions" https://spec.openapis.org/oas/v3.1.0#specificationExtensions}
);

// FIXME: Implement
// /// Allows configuration of the supported OAuth Flows.
// /// https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#oauthFlowsObject
// /// https://spec.openapis.org/oas/v3.1.0#oauthFlowsObject
// #[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Default)]
// pub struct OAuthFlows {
// }
8 changes: 4 additions & 4 deletions crates/oas3/src/spec/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ use super::{
/// 1. All traits that are affected by the location MUST be applicable to a location of
/// `header` (for example, [`style`]).
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#header-object>.
/// See <https://spec.openapis.org/oas/v3.1.0#header-object>.
///
/// [Parameter Object]: https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#parameter-object
/// [`style`]: https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#parameterStyle
/// [Parameter Object]: https://spec.openapis.org/oas/v3.1.0#parameter-object
/// [`style`]: https://spec.openapis.org/oas/v3.1.0#parameterStyle
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Default)]
pub struct Header {
/// A brief description of the header.
Expand Down Expand Up @@ -103,7 +103,7 @@ pub struct Header {
///
/// Only "x-" prefixed keys are collected, and the prefix is stripped.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#specification-extensions>.
/// See <https://spec.openapis.org/oas/v3.1.0#specification-extensions>.
#[serde(flatten, with = "spec_extensions")]
pub extensions: BTreeMap<String, serde_json::Value>,
}
Expand Down
6 changes: 3 additions & 3 deletions crates/oas3/src/spec/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use super::{spec_extensions, Contact, License};
/// General information about the API.
///
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#info-object>.
/// See <https://spec.openapis.org/oas/v3.1.0#info-object>.
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
// #[serde(rename_all = "lowercase")]
pub struct Info {
Expand All @@ -28,7 +28,7 @@ pub struct Info {
pub terms_of_service: Option<Url>,

/// The version of the OpenAPI document (which is distinct from the [OpenAPI Specification
/// version](https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#oasVersion)
/// version](https://spec.openapis.org/oas/v3.1.0#oasVersion)
/// or the API implementation version).
pub version: String,

Expand All @@ -44,7 +44,7 @@ pub struct Info {
///
/// Only "x-" prefixed keys are collected, and the prefix is stripped.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#specification-extensions>.
/// See <https://spec.openapis.org/oas/v3.1.0#specification-extensions>.
#[serde(flatten, with = "spec_extensions")]
pub extensions: BTreeMap<String, serde_json::Value>,
}
4 changes: 2 additions & 2 deletions crates/oas3/src/spec/license.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use super::spec_extensions;

/// License information for the exposed API.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#license-object>.
/// See <https://spec.openapis.org/oas/v3.1.0#license-object>.
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
pub struct License {
/// The license name used for the API.
Expand All @@ -25,7 +25,7 @@ pub struct License {
///
/// Only "x-" prefixed keys are collected, and the prefix is stripped.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#specification-extensions>.
/// See <https://spec.openapis.org/oas/v3.1.0#specification-extensions>.
#[serde(flatten, with = "spec_extensions")]
pub extensions: BTreeMap<String, serde_json::Value>,
}
18 changes: 9 additions & 9 deletions crates/oas3/src/spec/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ use super::{spec_extensions, Server};
/// The `operationRef` and `operationId` fields are mutually exclusive and so this structure is
/// modelled as an enum.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#link-object>.
/// See <https://spec.openapis.org/oas/v3.1.0#link-object>.
///
/// [runtime expression]: https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#runtime-expressions
/// [runtime expression]: https://spec.openapis.org/oas/v3.1.0#runtime-expressions
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[serde(untagged)]
pub enum Link {
Expand All @@ -33,7 +33,7 @@ pub enum Link {
/// [Operation Object]. Relative `operationRef` values MAY be used to locate an existing
/// [Operation Object] in the OpenAPI definition.
///
/// [Operation Object]: https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#operation-object
/// [Operation Object]: https://spec.openapis.org/oas/v3.1.0#operation-object
#[serde(rename = "operationRef")]
operation_ref: String,

Expand All @@ -44,7 +44,7 @@ pub enum Link {
/// qualified using the [parameter location] `[{in}.]{name}` for operations that use the
/// same parameter name in different locations (e.g. path.id).
///
/// [parameter location]: https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#parameterIn
/// [parameter location]: https://spec.openapis.org/oas/v3.1.0#parameterIn
//
// FIXME: Implement
// parameters: BTreeMap<String, Any | {expression}>,
Expand All @@ -54,7 +54,7 @@ pub enum Link {

// FIXME: Implement
// /// A literal value or
// /// [{expression}](https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#runtimeExpression)
// /// [{expression}](https://spec.openapis.org/oas/v3.1.0#runtimeExpression)
// /// to use as a request body when calling the target operation.
// #[serde(rename = "requestBody")]
// request_body: Any | {expression}
Expand All @@ -74,7 +74,7 @@ pub enum Link {
///
/// Only "x-" prefixed keys are collected, and the prefix is stripped.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#specification-extensions>.
/// See <https://spec.openapis.org/oas/v3.1.0#specification-extensions>.
#[serde(flatten, with = "spec_extensions")]
extensions: BTreeMap<String, serde_json::Value>,
},
Expand All @@ -93,7 +93,7 @@ pub enum Link {
/// qualified using the [parameter location] `[{in}.]{name}` for operations that use the
/// same parameter name in different locations (e.g. path.id).
///
/// [parameter location]: https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#parameterIn
/// [parameter location]: https://spec.openapis.org/oas/v3.1.0#parameterIn
//
// FIXME: Implement
// parameters: BTreeMap<String, Any | {expression}>,
Expand All @@ -103,7 +103,7 @@ pub enum Link {

// FIXME: Implement
// /// A literal value or
// /// [{expression}](https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#runtimeExpression)
// /// [{expression}](https://spec.openapis.org/oas/v3.1.0#runtimeExpression)
// /// to use as a request body when calling the target operation.
// #[serde(rename = "requestBody")]
// request_body: Any | {expression}
Expand All @@ -123,7 +123,7 @@ pub enum Link {
///
/// Only "x-" prefixed keys are collected, and the prefix is stripped.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#specification-extensions>.
/// See <https://spec.openapis.org/oas/v3.1.0#specification-extensions>.
#[serde(flatten, with = "spec_extensions")]
extensions: BTreeMap<String, serde_json::Value>,
},
Expand Down
2 changes: 1 addition & 1 deletion crates/oas3/src/spec/media_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use super::{Encoding, Error, Example, MediaTypeExamples, ObjectOrReference, Obje

/// Each Media Type Object provides schema and examples for the media type identified by its key.
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#media-type-object>.
/// See <https://spec.openapis.org/oas/v3.1.0#media-type-object>.
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Default)]
pub struct MediaType {
/// The schema defining the type used for the request body.
Expand Down
Loading

0 comments on commit bf9eb29

Please sign in to comment.