moonrockz/openrpc
Types
ClosedValidation
pub struct ClosedValidation {
report : ValidationReport
document : ValidatedDocument?
} derive(@moonbitlang/core/debug.Debug)ClosedValidation::document
fn ClosedValidation::document(self : ClosedValidation) -> ValidatedDocument?ClosedValidation::report
fn ClosedValidation::report(self : ClosedValidation) -> ValidationReportClosedValidation::to_repr
fn ClosedValidation::to_repr(ClosedValidation) -> @moonbitlang/core/debug.ReprComponents
pub struct Components {
value : @moonrockz/openrpc/json.Value
schemas : Array[(@moonrockz/openrpc/domain.ComponentKey, @moonrockz/openrpc/schema.Schema)]?
content_descriptors : Array[(@moonrockz/openrpc/domain.ComponentKey, ContentDescriptor)]?
examples : Array[(@moonrockz/openrpc/domain.ComponentKey, Example)]?
links : Array[(@moonrockz/openrpc/domain.ComponentKey, Link)]?
errors : Array[(@moonrockz/openrpc/domain.ComponentKey, ErrorObject)]?
tags : Array[(@moonrockz/openrpc/domain.ComponentKey, Tag)]?
example_pairings : Array[(@moonrockz/openrpc/domain.ComponentKey, ExamplePairing)]?
example_pairing_objects : Array[(@moonrockz/openrpc/domain.ComponentKey, ExamplePairing)]?
} derive(@moonbitlang/core/debug.Debug)Components::additional_fields
fn Components::additional_fields(self : Components) -> Array[(String, @moonrockz/openrpc/json.Value)]Components::content_descriptors
fn Components::content_descriptors(self : Components) -> Array[(@moonrockz/openrpc/domain.ComponentKey, ContentDescriptor)]?Components::errors
fn Components::errors(self : Components) -> Array[(@moonrockz/openrpc/domain.ComponentKey, ErrorObject)]?Components::example_pairing_objects
fn Components::example_pairing_objects(self : Components) -> Array[(@moonrockz/openrpc/domain.ComponentKey, ExamplePairing)]?Components::example_pairings
fn Components::example_pairings(self : Components) -> Array[(@moonrockz/openrpc/domain.ComponentKey, ExamplePairing)]?Components::examples
fn Components::examples(self : Components) -> Array[(@moonrockz/openrpc/domain.ComponentKey, Example)]?Components::extensions
fn Components::extensions(self : Components) -> @moonrockz/openrpc/domain.ExtensionsComponents::from_json
fn Components::from_json(value : @moonrockz/openrpc/json.Value, limits? : @moonrockz/openrpc/json.Limits) -> Result[Components, @moonrockz/openrpc/json.Diagnostic]Components::links
fn Components::links(self : Components) -> Array[(@moonrockz/openrpc/domain.ComponentKey, Link)]?Components::new
fn Components::new(schemas? : Array[(@moonrockz/openrpc/domain.ComponentKey, @moonrockz/openrpc/schema.Schema)]?, content_descriptors? : Array[(@moonrockz/openrpc/domain.ComponentKey, ContentDescriptor)]?, examples? : Array[(@moonrockz/openrpc/domain.ComponentKey, Example)]?, links? : Array[(@moonrockz/openrpc/domain.ComponentKey, Link)]?, errors? : Array[(@moonrockz/openrpc/domain.ComponentKey, ErrorObject)]?, tags? : Array[(@moonrockz/openrpc/domain.ComponentKey, Tag)]?, example_pairings? : Array[(@moonrockz/openrpc/domain.ComponentKey, ExamplePairing)]?, example_pairing_objects? : Array[(@moonrockz/openrpc/domain.ComponentKey, ExamplePairing)]?, extensions? : @moonrockz/openrpc/domain.Extensions, additional_fields? : Array[(String, @moonrockz/openrpc/json.Value)], limits? : @moonrockz/openrpc/json.Limits) -> Result[Components, @moonrockz/openrpc/json.Diagnostic]Components::schemas
fn Components::schemas(self : Components) -> Array[(@moonrockz/openrpc/domain.ComponentKey, @moonrockz/openrpc/schema.Schema)]?Components::tags
fn Components::tags(self : Components) -> Array[(@moonrockz/openrpc/domain.ComponentKey, Tag)]?Components::to_json
fn Components::to_json(self : Components) -> @moonrockz/openrpc/json.ValueComponents::to_repr
fn Components::to_repr(Components) -> @moonbitlang/core/debug.ReprContact
pub struct Contact {
value : @moonrockz/openrpc/json.Value
} derive(@moonbitlang/core/debug.Debug)Contact::additional_fields
fn Contact::additional_fields(self : Contact) -> Array[(String, @moonrockz/openrpc/json.Value)]Contact::email
fn Contact::email(self : Contact) -> String?Contact::extensions
fn Contact::extensions(self : Contact) -> @moonrockz/openrpc/domain.ExtensionsContact::from_json
fn Contact::from_json(value : @moonrockz/openrpc/json.Value, limits? : @moonrockz/openrpc/json.Limits) -> Result[Contact, @moonrockz/openrpc/json.Diagnostic]Contact::name
fn Contact::name(self : Contact) -> String?Contact::new
fn Contact::new(name? : String?, url? : @moonrockz/openrpc/reference.UriReference?, email? : String?, extensions? : @moonrockz/openrpc/domain.Extensions, additional_fields? : Array[(String, @moonrockz/openrpc/json.Value)], limits? : @moonrockz/openrpc/json.Limits) -> Result[Contact, @moonrockz/openrpc/json.Diagnostic]Contact::to_json
fn Contact::to_json(self : Contact) -> @moonrockz/openrpc/json.ValueContact::to_repr
fn Contact::to_repr(Contact) -> @moonbitlang/core/debug.ReprContact::url
fn Contact::url(self : Contact) -> @moonrockz/openrpc/reference.UriReference?ContentDescriptor
pub struct ContentDescriptor {
name : String
schema : @moonrockz/openrpc/schema.Schema
required : Bool?
value : @moonrockz/openrpc/json.Value
} derive(@moonbitlang/core/debug.Debug)ContentDescriptor::additional_fields
fn ContentDescriptor::additional_fields(self : ContentDescriptor) -> Array[(String, @moonrockz/openrpc/json.Value)]ContentDescriptor::deprecated
fn ContentDescriptor::deprecated(self : ContentDescriptor) -> Bool?ContentDescriptor::description
fn ContentDescriptor::description(self : ContentDescriptor) -> String?ContentDescriptor::extensions
fn ContentDescriptor::extensions(self : ContentDescriptor) -> @moonrockz/openrpc/domain.ExtensionsContentDescriptor::from_json
fn ContentDescriptor::from_json(value : @moonrockz/openrpc/json.Value, limits? : @moonrockz/openrpc/json.Limits) -> Result[ContentDescriptor, @moonrockz/openrpc/json.Diagnostic]ContentDescriptor::name
fn ContentDescriptor::name(self : ContentDescriptor) -> StringContentDescriptor::new
fn ContentDescriptor::new(name : String, schema : @moonrockz/openrpc/schema.Schema, summary? : String?, description? : String?, required? : Bool?, deprecated? : Bool?, extensions? : @moonrockz/openrpc/domain.Extensions, additional_fields? : Array[(String, @moonrockz/openrpc/json.Value)], limits? : @moonrockz/openrpc/json.Limits) -> Result[ContentDescriptor, @moonrockz/openrpc/json.Diagnostic]ContentDescriptor::required
fn ContentDescriptor::required(self : ContentDescriptor) -> Bool?ContentDescriptor::schema
fn ContentDescriptor::schema(self : ContentDescriptor) -> @moonrockz/openrpc/schema.SchemaContentDescriptor::summary
fn ContentDescriptor::summary(self : ContentDescriptor) -> String?ContentDescriptor::to_json
fn ContentDescriptor::to_json(self : ContentDescriptor) -> @moonrockz/openrpc/json.ValueContentDescriptor::to_repr
fn ContentDescriptor::to_repr(ContentDescriptor) -> @moonbitlang/core/debug.ReprCoverage
pub(all) enum Coverage {
Passed
Failed
Incomplete
} derive(Eq, @moonbitlang/core/debug.Debug)Coverage::equal
fn Coverage::equal(Coverage, Coverage) -> BoolCoverage::not_equal
fn Coverage::not_equal(x : Coverage, y : Coverage) -> BoolCoverage::to_repr
fn Coverage::to_repr(Coverage) -> @moonbitlang/core/debug.ReprDiscrepancy
pub(all) enum Discrepancy {
OptionalParameterBeforeRequired
ServerNameOmitted
LicenseNameOmitted
} derive(Eq, @moonbitlang/core/debug.Debug)A recorded disagreement between pinned prose and the pinned metaschema. Only these normative errors become warnings under MetaschemaCompatibility.
Discrepancy::equal
fn Discrepancy::equal(Discrepancy, Discrepancy) -> BoolDiscrepancy::not_equal
fn Discrepancy::not_equal(x : Discrepancy, y : Discrepancy) -> BoolDiscrepancy::to_repr
fn Discrepancy::to_repr(Discrepancy) -> @moonbitlang/core/debug.ReprDocument
pub struct Document {
version : DocumentVersion
info : Info
methods : Array[InlineOrReference[Method]]
value : @moonrockz/openrpc/json.Value
schema_uri : @moonrockz/openrpc/reference.UriReference?
servers : Array[Server]?
components : Components?
external_docs : ExternalDocumentation?
} derive(@moonbitlang/core/debug.Debug)Document::additional_fields
fn Document::additional_fields(self : Document) -> Array[(String, @moonrockz/openrpc/json.Value)]Document::as_resource
fn Document::as_resource(self : Document, uri : @moonrockz/openrpc/reference.UriReference, aliases? : Array[@moonrockz/openrpc/reference.UriReference], limits? : @moonrockz/openrpc/json.Limits) -> Result[@moonrockz/openrpc/reference.Resource, @moonrockz/openrpc/json.Diagnostic]The document as an explicit resource whose schema roots are every schema position in its typed model. Other values stay opaque.
Document::components
fn Document::components(self : Document) -> Components?Document::extensions
fn Document::extensions(self : Document) -> @moonrockz/openrpc/domain.ExtensionsDocument::external_docs
fn Document::external_docs(self : Document) -> ExternalDocumentation?Document::from_json
fn Document::from_json(value : @moonrockz/openrpc/json.Value, limits? : @moonrockz/openrpc/json.Limits) -> Result[Document, Array[@moonrockz/openrpc/json.Diagnostic]]Document::info
fn Document::info(self : Document) -> InfoDocument::methods
fn Document::methods(self : Document) -> Array[InlineOrReference[Method]]Document::new
fn Document::new(version : DocumentVersion, info : Info, methods : Array[InlineOrReference[Method]], schema? : @moonrockz/openrpc/reference.UriReference?, servers? : Array[Server]?, components? : Components?, external_docs? : ExternalDocumentation?, extensions? : @moonrockz/openrpc/domain.Extensions, additional_fields? : Array[(String, @moonrockz/openrpc/json.Value)], limits? : @moonrockz/openrpc/json.Limits) -> Result[Document, Array[@moonrockz/openrpc/json.Diagnostic]]Document::schema
fn Document::schema(self : Document) -> @moonrockz/openrpc/reference.UriReference?Document::servers
fn Document::servers(self : Document) -> Array[Server]?Document::to_json
fn Document::to_json(self : Document) -> @moonrockz/openrpc/json.ValueDocument::to_repr
fn Document::to_repr(Document) -> @moonbitlang/core/debug.ReprDocument::version
fn Document::version(self : Document) -> DocumentVersionDocumentVersion
pub struct DocumentVersion {
text : String
} derive(Eq, @moonbitlang/core/debug.Debug)DocumentVersion::equal
fn DocumentVersion::equal(DocumentVersion, DocumentVersion) -> BoolDocumentVersion::not_equal
fn DocumentVersion::not_equal(x : DocumentVersion, y : DocumentVersion) -> BoolDocumentVersion::parse
fn DocumentVersion::parse(text : String) -> Result[DocumentVersion, @moonrockz/openrpc/json.Diagnostic]DocumentVersion::to_repr
fn DocumentVersion::to_repr(DocumentVersion) -> @moonbitlang/core/debug.ReprDocumentVersion::to_string
fn DocumentVersion::to_string(self : DocumentVersion) -> StringErrorObject
pub struct ErrorObject {
value : @moonrockz/openrpc/json.Value
} derive(@moonbitlang/core/debug.Debug)ErrorObject::additional_fields
fn ErrorObject::additional_fields(self : ErrorObject) -> Array[(String, @moonrockz/openrpc/json.Value)]ErrorObject::code
fn ErrorObject::code(self : ErrorObject) -> @moonrockz/openrpc/domain.ErrorCodeErrorObject::data
fn ErrorObject::data(self : ErrorObject) -> @moonrockz/openrpc/json.Value?ErrorObject::extensions
fn ErrorObject::extensions(self : ErrorObject) -> @moonrockz/openrpc/domain.ExtensionsErrorObject::from_json
fn ErrorObject::from_json(value : @moonrockz/openrpc/json.Value, limits? : @moonrockz/openrpc/json.Limits) -> Result[ErrorObject, @moonrockz/openrpc/json.Diagnostic]ErrorObject::message
fn ErrorObject::message(self : ErrorObject) -> StringErrorObject::new
fn ErrorObject::new(code : @moonrockz/openrpc/domain.ErrorCode, message : String, data? : @moonrockz/openrpc/json.Value?, extensions? : @moonrockz/openrpc/domain.Extensions, additional_fields? : Array[(String, @moonrockz/openrpc/json.Value)], limits? : @moonrockz/openrpc/json.Limits) -> Result[ErrorObject, @moonrockz/openrpc/json.Diagnostic]ErrorObject::to_json
fn ErrorObject::to_json(self : ErrorObject) -> @moonrockz/openrpc/json.ValueErrorObject::to_repr
fn ErrorObject::to_repr(ErrorObject) -> @moonbitlang/core/debug.ReprExample
pub struct Example {
value : @moonrockz/openrpc/json.Value
} derive(@moonbitlang/core/debug.Debug)Example::additional_fields
fn Example::additional_fields(self : Example) -> Array[(String, @moonrockz/openrpc/json.Value)]Example::description
fn Example::description(self : Example) -> String?Example::extensions
fn Example::extensions(self : Example) -> @moonrockz/openrpc/domain.ExtensionsExample::from_json
fn Example::from_json(value : @moonrockz/openrpc/json.Value, limits? : @moonrockz/openrpc/json.Limits) -> Result[Example, @moonrockz/openrpc/json.Diagnostic]Example::name
fn Example::name(self : Example) -> String?Example::new
fn Example::new(payload : ExampleValue, name? : String?, summary? : String?, description? : String?, extensions? : @moonrockz/openrpc/domain.Extensions, additional_fields? : Array[(String, @moonrockz/openrpc/json.Value)], limits? : @moonrockz/openrpc/json.Limits) -> Result[Example, @moonrockz/openrpc/json.Diagnostic]Example::payload
fn Example::payload(self : Example) -> ExampleValueExample::summary
fn Example::summary(self : Example) -> String?Example::to_json
fn Example::to_json(self : Example) -> @moonrockz/openrpc/json.ValueExample::to_repr
fn Example::to_repr(Example) -> @moonbitlang/core/debug.ReprExamplePairing
pub struct ExamplePairing {
value : @moonrockz/openrpc/json.Value
} derive(@moonbitlang/core/debug.Debug)ExamplePairing::additional_fields
fn ExamplePairing::additional_fields(self : ExamplePairing) -> Array[(String, @moonrockz/openrpc/json.Value)]ExamplePairing::description
fn ExamplePairing::description(self : ExamplePairing) -> String?ExamplePairing::extensions
fn ExamplePairing::extensions(self : ExamplePairing) -> @moonrockz/openrpc/domain.ExtensionsExamplePairing::from_json
fn ExamplePairing::from_json(value : @moonrockz/openrpc/json.Value, limits? : @moonrockz/openrpc/json.Limits) -> Result[ExamplePairing, @moonrockz/openrpc/json.Diagnostic]ExamplePairing::name
fn ExamplePairing::name(self : ExamplePairing) -> StringExamplePairing::new
fn ExamplePairing::new(name : String, params : Array[InlineOrReference[Example]], summary? : String?, description? : String?, result? : InlineOrReference[Example]?, extensions? : @moonrockz/openrpc/domain.Extensions, additional_fields? : Array[(String, @moonrockz/openrpc/json.Value)], limits? : @moonrockz/openrpc/json.Limits) -> Result[ExamplePairing, @moonrockz/openrpc/json.Diagnostic]ExamplePairing::params
fn ExamplePairing::params(self : ExamplePairing) -> Array[InlineOrReference[Example]]ExamplePairing::result
fn ExamplePairing::result(self : ExamplePairing) -> InlineOrReference[Example]?ExamplePairing::summary
fn ExamplePairing::summary(self : ExamplePairing) -> String?ExamplePairing::to_json
fn ExamplePairing::to_json(self : ExamplePairing) -> @moonrockz/openrpc/json.ValueExamplePairing::to_repr
fn ExamplePairing::to_repr(ExamplePairing) -> @moonbitlang/core/debug.ReprExampleValue
pub(all) enum ExampleValue {
NoExampleValue
LiteralExample(@moonrockz/openrpc/json.Value)
ExternalExample(@moonrockz/openrpc/reference.UriReference)
} derive(@moonbitlang/core/debug.Debug)ExampleValue::to_repr
fn ExampleValue::to_repr(ExampleValue) -> @moonbitlang/core/debug.ReprExternalDocumentation
pub struct ExternalDocumentation {
value : @moonrockz/openrpc/json.Value
} derive(@moonbitlang/core/debug.Debug)ExternalDocumentation::additional_fields
fn ExternalDocumentation::additional_fields(self : ExternalDocumentation) -> Array[(String, @moonrockz/openrpc/json.Value)]ExternalDocumentation::description
fn ExternalDocumentation::description(self : ExternalDocumentation) -> String?ExternalDocumentation::extensions
fn ExternalDocumentation::extensions(self : ExternalDocumentation) -> @moonrockz/openrpc/domain.ExtensionsExternalDocumentation::from_json
fn ExternalDocumentation::from_json(value : @moonrockz/openrpc/json.Value, limits? : @moonrockz/openrpc/json.Limits) -> Result[ExternalDocumentation, @moonrockz/openrpc/json.Diagnostic]ExternalDocumentation::new
fn ExternalDocumentation::new(url : @moonrockz/openrpc/reference.UriReference, description? : String?, extensions? : @moonrockz/openrpc/domain.Extensions, additional_fields? : Array[(String, @moonrockz/openrpc/json.Value)], limits? : @moonrockz/openrpc/json.Limits) -> Result[ExternalDocumentation, @moonrockz/openrpc/json.Diagnostic]ExternalDocumentation::to_json
fn ExternalDocumentation::to_json(self : ExternalDocumentation) -> @moonrockz/openrpc/json.ValueExternalDocumentation::to_repr
fn ExternalDocumentation::to_repr(ExternalDocumentation) -> @moonbitlang/core/debug.ReprExternalDocumentation::url
fn ExternalDocumentation::url(self : ExternalDocumentation) -> @moonrockz/openrpc/reference.UriReferenceFinding
pub struct Finding {
diagnostic : @moonrockz/openrpc/json.Diagnostic
severity : Severity
phase : Phase
// private fields
} derive(@moonbitlang/core/debug.Debug)Finding::chain
fn Finding::chain(self : Finding) -> Array[FindingLocation]OpenRPC $ref sites followed, in order, to reach the location.
Finding::diagnostic
fn Finding::diagnostic(self : Finding) -> @moonrockz/openrpc/json.DiagnosticFinding::discrepancy
fn Finding::discrepancy(self : Finding) -> Discrepancy?The recorded prose/artifact discrepancy this normative finding belongs to.
Finding::expected_field
fn Finding::expected_field(self : Finding) -> String?The missing member's name when the location is its parent object.
Finding::location
fn Finding::location(self : Finding) -> FindingLocationFinding::phase
fn Finding::phase(self : Finding) -> PhaseFinding::profile
fn Finding::profile(self : Finding) -> ValidationProfileFinding::related
fn Finding::related(self : Finding) -> Array[FindingLocation]Other occurrences involved, such as the first of two duplicates.
Finding::severity
fn Finding::severity(self : Finding) -> SeverityFinding::to_repr
fn Finding::to_repr(Finding) -> @moonbitlang/core/debug.ReprFinding::version
fn Finding::version(self : Finding) -> DocumentVersionFindingLocation
pub struct FindingLocation {
// private fields
} derive(@moonbitlang/core/debug.Debug)Where a finding applies. resource is None for the unnamed input document.
Spans exist only for the input document, and only when its source map was
supplied.
FindingLocation::path
fn FindingLocation::path(self : FindingLocation) -> Array[String]FindingLocation::resource
fn FindingLocation::resource(self : FindingLocation) -> @moonrockz/openrpc/reference.UriReference?FindingLocation::source_id
fn FindingLocation::source_id(self : FindingLocation) -> String?FindingLocation::span
fn FindingLocation::span(self : FindingLocation) -> @moonrockz/openrpc/json.Span?FindingLocation::to_repr
fn FindingLocation::to_repr(FindingLocation) -> @moonbitlang/core/debug.ReprInfo
pub struct Info {
title : String
version : String
value : @moonrockz/openrpc/json.Value
} derive(@moonbitlang/core/debug.Debug)Info::additional_fields
fn Info::additional_fields(self : Info) -> Array[(String, @moonrockz/openrpc/json.Value)]Info::contact
fn Info::contact(self : Info) -> Contact?Info::description
fn Info::description(self : Info) -> String?Info::extensions
fn Info::extensions(self : Info) -> @moonrockz/openrpc/domain.ExtensionsInfo::from_json
fn Info::from_json(value : @moonrockz/openrpc/json.Value, limits? : @moonrockz/openrpc/json.Limits) -> Result[Info, @moonrockz/openrpc/json.Diagnostic]Info::license
fn Info::license(self : Info) -> License?Info::new
fn Info::new(title : String, version : String, description? : String?, terms_of_service? : @moonrockz/openrpc/reference.UriReference?, contact? : Contact?, license? : License?, extensions? : @moonrockz/openrpc/domain.Extensions, additional_fields? : Array[(String, @moonrockz/openrpc/json.Value)], limits? : @moonrockz/openrpc/json.Limits) -> Result[Info, @moonrockz/openrpc/json.Diagnostic]Info::terms_of_service
fn Info::terms_of_service(self : Info) -> @moonrockz/openrpc/reference.UriReference?Info::title
fn Info::title(self : Info) -> StringInfo::to_json
fn Info::to_json(self : Info) -> @moonrockz/openrpc/json.ValueInfo::to_repr
fn Info::to_repr(Info) -> @moonbitlang/core/debug.ReprInfo::version
fn Info::version(self : Info) -> StringInlineOrReference
pub(all) enum InlineOrReference[T] {
Inline(T)
Reference(@moonrockz/openrpc/reference.Reference)
} derive(@moonbitlang/core/debug.Debug)InlineOrReference::to_repr
fn[T : @moonbitlang/core/debug.Debug] InlineOrReference::to_repr(InlineOrReference[T]) -> @moonbitlang/core/debug.ReprLicense
pub struct License {
value : @moonrockz/openrpc/json.Value
} derive(@moonbitlang/core/debug.Debug)License::additional_fields
fn License::additional_fields(self : License) -> Array[(String, @moonrockz/openrpc/json.Value)]License::extensions
fn License::extensions(self : License) -> @moonrockz/openrpc/domain.ExtensionsLicense::from_json
fn License::from_json(value : @moonrockz/openrpc/json.Value, limits? : @moonrockz/openrpc/json.Limits) -> Result[License, @moonrockz/openrpc/json.Diagnostic]License::name
fn License::name(self : License) -> String?License::new
fn License::new(name? : String?, url? : @moonrockz/openrpc/reference.UriReference?, extensions? : @moonrockz/openrpc/domain.Extensions, additional_fields? : Array[(String, @moonrockz/openrpc/json.Value)], limits? : @moonrockz/openrpc/json.Limits) -> Result[License, @moonrockz/openrpc/json.Diagnostic]License::to_json
fn License::to_json(self : License) -> @moonrockz/openrpc/json.ValueLicense::to_repr
fn License::to_repr(License) -> @moonbitlang/core/debug.ReprLicense::url
fn License::url(self : License) -> @moonrockz/openrpc/reference.UriReference?Link
pub struct Link {
value : @moonrockz/openrpc/json.Value
} derive(@moonbitlang/core/debug.Debug)Link::additional_fields
fn Link::additional_fields(self : Link) -> Array[(String, @moonrockz/openrpc/json.Value)]Link::description
fn Link::description(self : Link) -> String?Link::extensions
fn Link::extensions(self : Link) -> @moonrockz/openrpc/domain.ExtensionsLink::from_json
fn Link::from_json(value : @moonrockz/openrpc/json.Value, limits? : @moonrockz/openrpc/json.Limits) -> Result[Link, @moonrockz/openrpc/json.Diagnostic]Link::name
fn Link::name(self : Link) -> String?Link::new
fn Link::new(name? : String?, summary? : String?, description? : String?, target_method? : MethodName?, params? : Array[(String, @moonrockz/openrpc/json.Value)]?, server? : Server?, extensions? : @moonrockz/openrpc/domain.Extensions, additional_fields? : Array[(String, @moonrockz/openrpc/json.Value)], limits? : @moonrockz/openrpc/json.Limits) -> Result[Link, @moonrockz/openrpc/json.Diagnostic]Link::params
fn Link::params(self : Link) -> Array[(String, @moonrockz/openrpc/json.Value)]?Link::server
fn Link::server(self : Link) -> Server?Link::summary
fn Link::summary(self : Link) -> String?Link::target_method
fn Link::target_method(self : Link) -> MethodName?Link::to_json
fn Link::to_json(self : Link) -> @moonrockz/openrpc/json.ValueLink::to_repr
fn Link::to_repr(Link) -> @moonbitlang/core/debug.ReprMethod
pub struct Method {
name : MethodName
params : Array[InlineOrReference[ContentDescriptor]]
result : InlineOrReference[ContentDescriptor]?
param_structure : ParamStructure?
value : @moonrockz/openrpc/json.Value
} derive(@moonbitlang/core/debug.Debug)Method::additional_fields
fn Method::additional_fields(self : Method) -> Array[(String, @moonrockz/openrpc/json.Value)]Method::deprecated
fn Method::deprecated(self : Method) -> Bool?Method::description
fn Method::description(self : Method) -> String?Method::errors
fn Method::errors(self : Method) -> Array[InlineOrReference[ErrorObject]]?Method::examples
fn Method::examples(self : Method) -> Array[InlineOrReference[ExamplePairing]]?Method::extensions
fn Method::extensions(self : Method) -> @moonrockz/openrpc/domain.ExtensionsMethod::external_docs
fn Method::external_docs(self : Method) -> ExternalDocumentation?Method::from_json
fn Method::from_json(value : @moonrockz/openrpc/json.Value, limits? : @moonrockz/openrpc/json.Limits) -> Result[Method, @moonrockz/openrpc/json.Diagnostic]Method::links
fn Method::links(self : Method) -> Array[InlineOrReference[Link]]?Method::name
fn Method::name(self : Method) -> MethodNameMethod::new
fn Method::new(name : MethodName, params : Array[InlineOrReference[ContentDescriptor]], result? : InlineOrReference[ContentDescriptor]?, tags? : Array[InlineOrReference[Tag]]?, summary? : String?, description? : String?, external_docs? : ExternalDocumentation?, deprecated? : Bool?, servers? : Array[Server]?, errors? : Array[InlineOrReference[ErrorObject]]?, links? : Array[InlineOrReference[Link]]?, param_structure? : ParamStructure?, examples? : Array[InlineOrReference[ExamplePairing]]?, extensions? : @moonrockz/openrpc/domain.Extensions, additional_fields? : Array[(String, @moonrockz/openrpc/json.Value)], limits? : @moonrockz/openrpc/json.Limits) -> Result[Method, @moonrockz/openrpc/json.Diagnostic]Method::param_structure
fn Method::param_structure(self : Method) -> ParamStructure?Method::params
fn Method::params(self : Method) -> Array[InlineOrReference[ContentDescriptor]]Method::result
fn Method::result(self : Method) -> InlineOrReference[ContentDescriptor]?Method::servers
fn Method::servers(self : Method) -> Array[Server]?Method::summary
fn Method::summary(self : Method) -> String?Method::tags
fn Method::tags(self : Method) -> Array[InlineOrReference[Tag]]?Method::to_json
fn Method::to_json(self : Method) -> @moonrockz/openrpc/json.ValueMethod::to_repr
fn Method::to_repr(Method) -> @moonbitlang/core/debug.ReprMethodName
pub struct MethodName {
text : String
} derive(Eq, @moonbitlang/core/debug.Debug)MethodName::equal
fn MethodName::equal(MethodName, MethodName) -> BoolMethodName::not_equal
fn MethodName::not_equal(x : MethodName, y : MethodName) -> BoolMethodName::parse
fn MethodName::parse(text : String) -> Result[MethodName, @moonrockz/openrpc/json.Diagnostic]MethodName::to_repr
fn MethodName::to_repr(MethodName) -> @moonbitlang/core/debug.ReprMethodName::to_string
fn MethodName::to_string(self : MethodName) -> StringObjectKind
pub(all) enum ObjectKind {
DocumentObject
InfoObject
ContactObject
LicenseObject
ExternalDocumentationObject
ServerVariableObject
ServerObject
MethodObject
ContentDescriptorObject
TagObject
ErrorObjectKind
ExampleObject
ExamplePairingObject
LinkObject
ComponentsObject
ReferenceObject
} derive(Eq, @moonbitlang/core/debug.Debug)ObjectKind::equal
fn ObjectKind::equal(ObjectKind, ObjectKind) -> BoolObjectKind::name
fn ObjectKind::name(self : ObjectKind) -> StringObjectKind::not_equal
fn ObjectKind::not_equal(x : ObjectKind, y : ObjectKind) -> BoolObjectKind::to_repr
fn ObjectKind::to_repr(ObjectKind) -> @moonbitlang/core/debug.ReprParamStructure
pub(all) enum ParamStructure {
ByName
ByPosition
Either
} derive(Eq, @moonbitlang/core/debug.Debug)ParamStructure::equal
fn ParamStructure::equal(ParamStructure, ParamStructure) -> BoolParamStructure::not_equal
fn ParamStructure::not_equal(x : ParamStructure, y : ParamStructure) -> BoolParamStructure::to_repr
fn ParamStructure::to_repr(ParamStructure) -> @moonbitlang/core/debug.ReprParamStructure::to_string
fn ParamStructure::to_string(self : ParamStructure) -> StringPhase
pub(all) enum Phase {
Model
SchemaDocument
References
Normative
Artifact
} derive(Eq, @moonbitlang/core/debug.Debug)Phase::equal
fn Phase::equal(Phase, Phase) -> BoolPhase::not_equal
fn Phase::not_equal(x : Phase, y : Phase) -> BoolPhase::to_repr
fn Phase::to_repr(Phase) -> @moonbitlang/core/debug.ReprReadResult
pub struct ReadResult {
cst : @moonrockz/openrpc/json.CstDocument?
document : Document?
diagnostics : Array[@moonrockz/openrpc/json.Diagnostic]
} derive(@moonbitlang/core/debug.Debug)ReadResult::cst
fn ReadResult::cst(self : ReadResult) -> @moonrockz/openrpc/json.CstDocument?ReadResult::diagnostics
fn ReadResult::diagnostics(self : ReadResult) -> Array[@moonrockz/openrpc/json.Diagnostic]ReadResult::document
fn ReadResult::document(self : ReadResult) -> Document?ReadResult::source_map
fn ReadResult::source_map(self : ReadResult) -> @moonrockz/openrpc/json.SourceMap?ReadResult::to_repr
fn ReadResult::to_repr(ReadResult) -> @moonbitlang/core/debug.ReprServer
pub struct Server {
value : @moonrockz/openrpc/json.Value
} derive(@moonbitlang/core/debug.Debug)Server::additional_fields
fn Server::additional_fields(self : Server) -> Array[(String, @moonrockz/openrpc/json.Value)]Server::description
fn Server::description(self : Server) -> String?Server::extensions
fn Server::extensions(self : Server) -> @moonrockz/openrpc/domain.ExtensionsServer::from_json
fn Server::from_json(value : @moonrockz/openrpc/json.Value, limits? : @moonrockz/openrpc/json.Limits) -> Result[Server, @moonrockz/openrpc/json.Diagnostic]Server::name
fn Server::name(self : Server) -> String?Server::new
fn Server::new(url : String, name? : String?, summary? : String?, description? : String?, variables? : Array[(String, ServerVariable)]?, extensions? : @moonrockz/openrpc/domain.Extensions, additional_fields? : Array[(String, @moonrockz/openrpc/json.Value)], limits? : @moonrockz/openrpc/json.Limits) -> Result[Server, @moonrockz/openrpc/json.Diagnostic]Server::summary
fn Server::summary(self : Server) -> String?Server::to_json
fn Server::to_json(self : Server) -> @moonrockz/openrpc/json.ValueServer::to_repr
fn Server::to_repr(Server) -> @moonbitlang/core/debug.ReprServer::url
fn Server::url(self : Server) -> StringServer::variables
fn Server::variables(self : Server) -> Array[(String, ServerVariable)]?ServerVariable
pub struct ServerVariable {
value : @moonrockz/openrpc/json.Value
} derive(@moonbitlang/core/debug.Debug)ServerVariable::additional_fields
fn ServerVariable::additional_fields(self : ServerVariable) -> Array[(String, @moonrockz/openrpc/json.Value)]ServerVariable::default_value
fn ServerVariable::default_value(self : ServerVariable) -> StringServerVariable::description
fn ServerVariable::description(self : ServerVariable) -> String?ServerVariable::enum_values
fn ServerVariable::enum_values(self : ServerVariable) -> Array[String]?ServerVariable::extensions
fn ServerVariable::extensions(self : ServerVariable) -> @moonrockz/openrpc/domain.ExtensionsServerVariable::from_json
fn ServerVariable::from_json(value : @moonrockz/openrpc/json.Value, limits? : @moonrockz/openrpc/json.Limits) -> Result[ServerVariable, @moonrockz/openrpc/json.Diagnostic]ServerVariable::new
fn ServerVariable::new(default_value : String, enum_values? : Array[String]?, description? : String?, extensions? : @moonrockz/openrpc/domain.Extensions, additional_fields? : Array[(String, @moonrockz/openrpc/json.Value)], limits? : @moonrockz/openrpc/json.Limits) -> Result[ServerVariable, @moonrockz/openrpc/json.Diagnostic]ServerVariable::to_json
fn ServerVariable::to_json(self : ServerVariable) -> @moonrockz/openrpc/json.ValueServerVariable::to_repr
fn ServerVariable::to_repr(ServerVariable) -> @moonbitlang/core/debug.ReprSeverity
pub(all) enum Severity {
Error
Warning
Information
} derive(Eq, @moonbitlang/core/debug.Debug)Severity::equal
fn Severity::equal(Severity, Severity) -> BoolSeverity::not_equal
fn Severity::not_equal(x : Severity, y : Severity) -> BoolSeverity::to_repr
fn Severity::to_repr(Severity) -> @moonbitlang/core/debug.ReprTag
pub struct Tag {
value : @moonrockz/openrpc/json.Value
} derive(@moonbitlang/core/debug.Debug)Tag::additional_fields
fn Tag::additional_fields(self : Tag) -> Array[(String, @moonrockz/openrpc/json.Value)]Tag::description
fn Tag::description(self : Tag) -> String?Tag::extensions
fn Tag::extensions(self : Tag) -> @moonrockz/openrpc/domain.ExtensionsTag::external_docs
fn Tag::external_docs(self : Tag) -> ExternalDocumentation?Tag::from_json
fn Tag::from_json(value : @moonrockz/openrpc/json.Value, limits? : @moonrockz/openrpc/json.Limits) -> Result[Tag, @moonrockz/openrpc/json.Diagnostic]Tag::name
fn Tag::name(self : Tag) -> StringTag::new
fn Tag::new(name : String, summary? : String?, description? : String?, external_docs? : ExternalDocumentation?, extensions? : @moonrockz/openrpc/domain.Extensions, additional_fields? : Array[(String, @moonrockz/openrpc/json.Value)], limits? : @moonrockz/openrpc/json.Limits) -> Result[Tag, @moonrockz/openrpc/json.Diagnostic]Tag::summary
fn Tag::summary(self : Tag) -> String?Tag::to_json
fn Tag::to_json(self : Tag) -> @moonrockz/openrpc/json.ValueTag::to_repr
fn Tag::to_repr(Tag) -> @moonbitlang/core/debug.ReprValidatedDocument
pub struct ValidatedDocument {
document : Document
report : ValidationReport
// private fields
} derive(@moonbitlang/core/debug.Debug)A document whose required facets all passed for one profile and one explicit resource snapshot.
ValidatedDocument::document
fn ValidatedDocument::document(self : ValidatedDocument) -> DocumentValidatedDocument::profile
fn ValidatedDocument::profile(self : ValidatedDocument) -> ValidationProfileValidatedDocument::report
fn ValidatedDocument::report(self : ValidatedDocument) -> ValidationReportValidatedDocument::resources
fn ValidatedDocument::resources(self : ValidatedDocument) -> Array[@moonrockz/openrpc/reference.UriReference]Retrieval URIs of the resource snapshot the document was closed against.
ValidatedDocument::to_repr
fn ValidatedDocument::to_repr(ValidatedDocument) -> @moonbitlang/core/debug.ReprValidatedDocument::version
fn ValidatedDocument::version(self : ValidatedDocument) -> DocumentVersionValidationProfile
pub(all) enum ValidationProfile {
Specification
MetaschemaCompatibility
} derive(Eq, @moonbitlang/core/debug.Debug)ValidationProfile::equal
fn ValidationProfile::equal(ValidationProfile, ValidationProfile) -> BoolValidationProfile::not_equal
fn ValidationProfile::not_equal(x : ValidationProfile, y : ValidationProfile) -> BoolValidationProfile::to_repr
fn ValidationProfile::to_repr(ValidationProfile) -> @moonbitlang/core/debug.ReprValidationReport
pub struct ValidationReport {
profile : ValidationProfile
version : DocumentVersion
findings : Array[Finding]
model : Coverage
schemas : Coverage
references : Coverage
normative : Coverage
artifact : Coverage
} derive(@moonbitlang/core/debug.Debug)ValidationReport::artifact
fn ValidationReport::artifact(self : ValidationReport) -> CoverageValidationReport::findings
fn ValidationReport::findings(self : ValidationReport) -> Array[Finding]Findings in deterministic order: resource, pointer tokens, code, source occurrence, then message.
ValidationReport::model
fn ValidationReport::model(self : ValidationReport) -> CoverageValidationReport::normative
fn ValidationReport::normative(self : ValidationReport) -> CoverageValidationReport::profile
fn ValidationReport::profile(self : ValidationReport) -> ValidationProfileValidationReport::references
fn ValidationReport::references(self : ValidationReport) -> CoverageValidationReport::schemas
fn ValidationReport::schemas(self : ValidationReport) -> CoverageValidationReport::to_repr
fn ValidationReport::to_repr(ValidationReport) -> @moonbitlang/core/debug.ReprValidationReport::version
fn ValidationReport::version(self : ValidationReport) -> DocumentVersionType aliases
ComponentKey
using @moonrockz/openrpc/domain { type ComponentKey }
Shared checked values for OpenRPC documents and embedded schemas.
ErrorCode
using @moonrockz/openrpc/domain { type ErrorCode }
ExtensionName
using @moonrockz/openrpc/domain { type ExtensionName }
Extensions
using @moonrockz/openrpc/domain { type Extensions }
Format
using @moonrockz/openrpc/json { type Format }
Output layout. Compact is canonical; Pretty adds two-space indentation
and changes nothing else.
Values
compatibility_discrepancies
fn compatibility_discrepancies() -> Array[Discrepancy]The frozen downgrade list. Adding an entry changes public behavior.
field_names
fn field_names(kind : ObjectKind) -> Array[String]lower
fn lower(cst : @moonrockz/openrpc/json.CstDocument) -> ReadResultobject_kinds
fn object_kinds() -> Array[ObjectKind]read
fn read(source : String, source_id? : String?, limits? : @moonrockz/openrpc/json.Limits) -> ReadResultreplace_value
fn replace_value(cst : @moonrockz/openrpc/json.CstDocument, node : @moonrockz/openrpc/json.NodeId, value : @moonrockz/openrpc/json.Value, limits? : @moonrockz/openrpc/json.Limits) -> Result[ReadResult, @moonrockz/openrpc/json.Diagnostic]Replace one existing value in a parsed document and read the result again.
Diagnostics use the new source map; node handles from cst become stale.
validate
fn validate(document : Document, profile? : ValidationProfile, resources? : @moonrockz/openrpc/reference.ResourceSet, base? : @moonrockz/openrpc/reference.UriReference?, source_map? : @moonrockz/openrpc/json.SourceMap?, limits? : @moonrockz/openrpc/json.Limits) -> ValidationReportValidate a document against explicit resources. base is the document's
retrieval URI; relative references and schema identifiers need it. Nothing
is fetched. Unsupplied resources leave reference coverage incomplete. A
source_map from reading the same document adds spans to its findings.
validate_closed
fn validate_closed(document : Document, profile? : ValidationProfile, resources? : @moonrockz/openrpc/reference.ResourceSet, base? : @moonrockz/openrpc/reference.UriReference?, source_map? : @moonrockz/openrpc/json.SourceMap?, limits? : @moonrockz/openrpc/json.Limits) -> ClosedValidationwrite
fn write(document : Document, format? : @moonrockz/openrpc/json.Format, limits? : @moonrockz/openrpc/json.Limits) -> Result[String, @moonrockz/openrpc/json.Diagnostic]Canonical JSON for a document. It is not source reproduction (see
CstDocument::reproduce) and not RFC 8785 canonicalization.