~/bend-docscommunity

src/openapi.bend checks

raw source on the hub · import ezmcp@0.3.0.0/src/openapi.bend as Openapi

ezmcp/src/openapi: an OpenAPI 3.0 or 3.1 document as an MCP tool table, and a tool call as the HTTP request it stands for, with no IO. Every operation of the document's paths is one tool: its name is the operation's id, its arguments are the operation's parameters by name and its request body as requestBody. A call's arguments are checked against the tool's input schema, then filled into the path template, the query string and the header fields. The caller reads the document and sends the request. Where the specifications leave a choice open, the choice is openapi-mcp-generator's (v4), so a server it generated keeps its tools. The OpenAPI guarantees under laws/ (laws/OperationsFromPaths.bend first) state what is guaranteed.

7 imports
import Base
import ezjson@1.2.0.0/main.bend as Json
import ezjson@1.2.0.0/src/value.bend as Value
import ezhttp@0.23.0.0/src/http.bend as Http
import ezhttp@0.23.0.0/src/pct.bend as Pct
import ezhttp@0.23.0.0/src/qs.bend as Qs
import ./server.bend as Server

Types

type Place source · line 22 · raw

Data

where a parameter goes (Parameter Object in); InNone for a location OpenAPI does not have

type Param source · line 30 · raw

Data

a parameter a request is built from: its name and where it goes

type Op source · line 36 · raw

Data

one operation as a tool: the tool's name, description and input schema, and what its calls are sent as: the method (upper case), the path template, the parameters, and the request body's media type ("" for none)

type Call source · line 43 · raw

Data

the request a tool call stands for: a method, a target (the path and its query), the header fields and the body; or the path template when a template expression is still in it

type Kids source · line 480 · raw

Data

what a mapped schema recurses into: its properties when its type is "object", its items when its type is "array", else nothing

type Prop source · line 531 · raw

Data

whether a property's value is a schema to map, kept as it is, or left out

type Read source · line 562 · raw

Data

what shape reads its value as: a schema, or the cells of a properties object

type In source · line 809 · raw

Data

an input schema being built: its properties and its required names

type Req source · line 1167 · raw

Data

a request being built: the path, the query's pairs and the header fields

Definitions

def or.else source · line 51 · raw

@hit:Bool -> @rest:(@_:Unit -> Bool) -> Bool

true at a hit, else the rest of the search

def and.then source · line 59 · raw

@ok:Bool -> @rest:(@_:Unit -> Bool) -> Bool

false at a miss, else the rest of the check

def Mem source · line 69 · raw

Data

an object member: its name and value, reusable

def cells source · line 73 · raw

@ps:List<&2, Mem> -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

members as the cells of an object, in order

def object source · line 81 · raw

@ps:List<&2, Mem> -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

the object of members, in order

def members.go source · line 84 · raw

@cs:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> List<&2, Mem>

def members source · line 94 · raw

@val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> List<&2, Mem>

an object's members in order; none for any other value

def put.at source · line 101 · raw

@hit:Bool -> @k2:String -> @v2:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @rest:List<&2, Mem> -> @key:String -> @val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @more:(@_:Unit -> List<&2, Mem>) -> List<&2, Mem>

def put source · line 118 · raw

@ps:List<&2, Mem> -> @+key:String -> @+val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> List<&2, Mem>

members with key set to val: in the place of the first member of that name, else last, as a JavaScript assignment puts it

def drop.at source · line 125 · raw

@hit:Bool -> @k2:String -> @v2:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @rest:List<&2, Mem> -> List<&2, Mem>

def drop source · line 138 · raw

@ps:List<&2, Mem> -> @+key:String -> List<&2, Mem>

members less every one named key, the rest in order

def named source · line 146 · raw

@ps:List<&2, Mem> -> @+key:String -> Bool

whether members have one named key

def lookup.at source · line 153 · raw

@hit:Bool -> @val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @more:(@_:Unit -> Maybe<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json>) -> Maybe<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json>

def lookup source · line 165 · raw

@ps:List<&2, Mem> -> @+key:String -> Maybe<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json>

the value of the first member named key

def value source · line 173 · raw

@ps:List<&2, Mem> -> @key:String -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

a member's value, null when there is none

def full source · line 179 · raw

@text:Maybe<&2, String> -> Maybe<&2, String>

a string when it is not empty, as JavaScript's || takes it

def first source · line 187 · raw

@lead:Maybe<&2, String> -> @next:Maybe<&2, String> -> Maybe<&2, String>

the first of two maybe strings that is there

def is_true source · line 195 · raw

@val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Bool

whether a value is JSON true

def is_null source · line 203 · raw

@val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Bool

whether a value is JSON null

def is_str.of source · line 210 · raw

@text:Maybe<&2, String> -> @+str:String -> Bool

def is_str source · line 218 · raw

@val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @+str:String -> Bool

whether a value is the string str

def str.at source · line 222 · raw

@val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @key:String -> String

a member's string, "" when it is not one

def token.go source · line 227 · raw

@cs:String -> String

def token source · line 239 · raw

@text:String -> String

one reference token decoded: ~1 as / and ~0 as ~ (RFC 6901 §4)

def walk.at source · line 242 · raw

@hit:Bool -> @next:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @more:(@_:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Maybe<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json>) -> Maybe<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json>

def walk source · line 255 · raw

@toks:List<&2, String> -> @+val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Maybe<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json>

the value at a pointer's tokens, each a member name, or none when a member is missing

def resolve.at source · line 263 · raw

@local:Bool -> @+doc:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @ref:String -> Maybe<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json>

def resolve source · line 272 · raw

@+doc:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @+ref:String -> Maybe<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json>

what a local reference (#/ and a JSON Pointer) points to in the document; none for a reference that is not local or points to nothing

def ref.of source · line 276 · raw

@pairs:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Maybe<&2, String>

a $ref member's string, when the cells have one

def seen source · line 280 · raw

@refs:List<&2, String> -> @+ref:String -> Bool

whether a reference is one being followed already

def merge.one source · line 287 · raw

@hit:Bool -> @+sib:List<&2, Mem> -> @key:String -> @val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> List<&2, Mem>

def merge.add source · line 299 · raw

@ts:List<&2, Mem> -> @+sib:List<&2, Mem> -> List<&2, Mem>

def merge.of source · line 306 · raw

@empty:Bool -> @sib:List<&2, Mem> -> @+target:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

def merge source · line 317 · raw

@+sib:List<&2, Mem> -> @+target:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

a reference's target with the reference object's other members: the target itself when there are none; else those members first, then the target's members they do not name (Reference Object: a sibling description overrides the target's)

def cyclic source · line 321 · raw

0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

the schema a reference cycle stands for

def deref.found source · line 324 · raw

@found:Maybe<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json> -> @plain:(@_:Unit -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json) -> @follow:(@_:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json) -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

def deref.ref source · line 335 · raw

@cycle:Bool -> @+ref:String -> @+doc:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @plain:(@_:Unit -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json) -> @follow:(@_:String -> @_:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json) -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

def deref.obj source · line 348 · raw

@ref:Maybe<&2, String> -> @+doc:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @+refs:List<&2, String> -> @plain:(@_:Unit -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json) -> @follow:(@_:String -> @_:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json) -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

def deref source · line 366 · raw

@fuel:Nat -> @val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @+doc:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @+refs:List<&2, String> -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

a value with every local reference in it replaced by its target, merged with the reference object's other members (merge); a reference to one of refs, the references being followed, is a cycle (cyclic), and one that does not resolve is left as it is. fuel bounds how deep values and references nest

def depth source · line 397 · raw

Nat

how deep a value's references and schemas may nest before the rest is left as it is

def dereferenced source · line 401 · raw

@+doc:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

a value of the document with its local references followed

def extras source · line 408 · raw

List<&2, String>

the OpenAPI 3.0 fields of a Schema Object that are not JSON Schema, which an input schema leaves out

def drop.all source · line 413 · raw

@keys:List<&2, String> -> @ps:List<&2, Mem> -> List<&2, Mem>

members less every one named by keys

def number source · line 421 · raw

@+typ:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

integer as JSON Schema's number, any other type as it is

def with.null.arr source · line 424 · raw

@has:Bool -> @+items:List<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json> -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

def any.null source · line 431 · raw

@items:List<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json> -> Bool

def with.null source · line 441 · raw

@typ:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

a type that also admits null (OpenAPI 3.0 nullable): a type name as an array of it and "null", an array of names with "null" added when it lacks it, anything else as it is

def typed.null source · line 453 · raw

@nullable:Bool -> @+typ:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

def typed.of source · line 460 · raw

@ps:List<&2, Mem> -> @typ:Maybe<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json> -> @nullable:Bool -> List<&2, Mem>

def own source · line 474 · raw

@+ps:List<&2, Mem> -> List<&2, Mem>

a schema's own members as an input schema has them: the OpenAPI 3.0 extras left out, integer as number, and nullable true adding null to an explicit type, every other member as it is, in order

def kids.props source · line 485 · raw

@props:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Kids

def kids.item source · line 492 · raw

@+item:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Kids

def kids.array source · line 495 · raw

@array:Bool -> @+ps:List<&2, Mem> -> Kids

def kids.of source · line 502 · raw

@object:Bool -> @array:Bool -> @+ps:List<&2, Mem> -> Kids

def kids source · line 512 · raw

@+ps:List<&2, Mem> -> Kids

what a schema's members recurse into: its properties' cells when its type is "object" and its properties an object, its items when its type is "array" and its items an object, else nothing

def kids.put source · line 516 · raw

@+ps:List<&2, Mem> -> @kid:Kids -> @props:(@_:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json) -> @item:(@_:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json) -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

def prop.of source · line 536 · raw

@val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Prop

def prop.put source · line 545 · raw

@kind:Prop -> @key:String -> @+val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @go:(@_:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json) -> @rest:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

def shape source · line 570 · raw

@fuel:Nat -> @val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @read:Read -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

a schema as an input schema (own), its properties' and items' schemas mapped the same way; or the cells of a properties object with every schema value mapped, a boolean kept and any other value left out. fuel bounds how deep schemas nest

def schema source · line 592 · raw

@val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

a Schema Object as the JSON Schema of an input

def name.ok source · line 599 · raw

@+cp:U32 -> Bool

whether a character may stand in a tool name: an ASCII letter or digit, _ or -

def name.char source · line 605 · raw

@ok:Bool -> @+cp:U32 -> Char

def sanitize source · line 614 · raw

@text:String -> String

a string as a tool name: each character that may not stand in one (name.ok) as _, one for one

def title.go source · line 621 · raw

@cs:String -> String

def capital source · line 635 · raw

@text:String -> String

a string with its first character in upper case

def strip.lead.at source · line 642 · raw

@hit:Bool -> @ch:Char -> @rest:String -> String

def strip.lead source · line 649 · raw

@text:String -> @+want:Char -> String

def title source · line 660 · raw

@text:String -> String

a path segment in title case, as openapi-mcp-generator writes one: lower case, each -, _ or / and the character after it as that character in upper case, less a leading { and a trailing }, the first character in upper case

def is_param source · line 665 · raw

@+part:String -> Bool

whether a path segment is a template expression, { to }

def segments.at source · line 668 · raw

@empty:Bool -> @part:String -> @rest:List<&2, String> -> List<&2, String>

def segments source · line 680 · raw

@parts:List<&2, String> -> List<&2, String>

the pieces of a split path that are not empty

def gen.param source · line 687 · raw

@last:Bool -> @+part:String -> String

def gen.part source · line 694 · raw

@param:Bool -> @+part:String -> @last:Bool -> String

def gen.parts source · line 701 · raw

@parts:List<&2, String> -> String

def gen.root source · line 709 · raw

@bare:Bool -> @+name:String -> String

def generated source · line 720 · raw

@+method:String -> @path:String -> String

an operation id made from the method and the path, for an operation with none, as openapi-mcp-generator makes it: the method, each path segment in title case, a parameter segment only when it is the last and then after "By", "Root" when there are no segments, the first letter in upper case

def name.of source · line 726 · raw

@id:Maybe<&2, String> -> @+method:String -> @path:String -> String

a tool's name: the operation's id when it is a non-empty string, else one made from the method and path (generated), as a tool name (sanitize)

def describe source · line 731 · raw

@desc:Maybe<&2, String> -> @summary:Maybe<&2, String> -> @+method:String -> @path:String -> String

a tool's description: the operation's description, else its summary, each when it is a non-empty string, else the method and path it runs

def same source · line 744 · raw

@+left:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @+right:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Bool

whether two Parameter Objects are one parameter: the same name and the same location

def params.put.at source · line 748 · raw

@hit:Bool -> @old:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @rest:List<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json> -> @new:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @more:(@_:Unit -> List<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json>) -> List<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json>

def params.put source · line 763 · raw

@ps:List<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json> -> @+new:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> List<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json>

parameters with new in the place of the first that is the same parameter (same), else last

def params.merge source · line 772 · raw

@ops:List<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json> -> @ps:List<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json> -> List<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json>

a Path Item's parameters ps, each of its operation's ops in turn put in them (params.put)

def place source · line 783 · raw

@+loc:String -> Place

where a parameter goes, from its in

def param.of source · line 789 · raw

@name:Maybe<&2, String> -> @+loc:String -> List<&2, Param>

def params.of source · line 798 · raw

@ps:List<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json> -> List<&2, Param>

the parameters a request is built from: each with a non-empty name, and where it goes

def described.at source · line 812 · raw

@is_obj:Bool -> @+val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @desc:String -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

def described source · line 821 · raw

@+val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @desc:Maybe<&2, String> -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

a schema with its description set to desc, in its place or last, when it is an object and there is one to set

def need source · line 829 · raw

@req:List<&2, String> -> @name:String -> @want:Bool -> List<&2, String>

name added to the end of the required names when want

def schema.ok source · line 837 · raw

@val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Bool

whether a value stands as a schema: an object or true

def input.param.put source · line 846 · raw

@+name:String -> @+one:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @st:In -> In

def input.param.of source · line 857 · raw

@name:Maybe<&2, String> -> @ok:Bool -> @+one:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @st:In -> In

a parameter as an input property: one with a name and a schema is the property of that name, its schema mapped (schema) and described by the parameter's description when that is a non-empty string, and required when the parameter is; any other leaves the input as it is

def input.param source · line 869 · raw

@+one:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @st:In -> In

def input.params source · line 873 · raw

@ps:List<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json> -> @st:In -> In

def media.first source · line 880 · raw

@ms:List<&2, Mem> -> String

def media.at source · line 887 · raw

@json:Bool -> @+content:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> String

def media source · line 896 · raw

@+content:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> String

a request body's media type: application/json when its content has a schema for it, else the first media type of its content, else none ("")

def body.json source · line 900 · raw

@+rb:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

def body.text source · line 907 · raw

@+rb:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @mt:String -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

def body.schema source · line 912 · raw

@json:Bool -> @+rb:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @mt:String -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

def input.body.of source · line 919 · raw

@+rb:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @+mt:String -> @st:In -> In

def input.body.at source · line 926 · raw

@none:Bool -> @+rb:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @+mt:String -> @st:In -> In

def input.body source · line 938 · raw

@+rb:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @+mt:String -> @st:In -> In

a Request Body Object as the requestBody property, with its media type mt (media): application/json's schema, mapped and described by the body's description, else the schema's, else "The JSON request body."; for another media type a string; required when the body is. A body of no media type adds nothing

def strs source · line 942 · raw

@xs:List<&2, String> -> List<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json>

strings as JSON strings

def required source · line 950 · raw

@req:List<&2, String> -> List<&2, Mem>

the required member of an input schema, none for no names

def input.of source · line 959 · raw

@st:In -> 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json

the input schema built: an object schema of the properties, with the required names when there are any

def methods source · line 969 · raw

List<&2, String>

the methods a Path Item may have an operation for, in the order their tools are listed

def media.of source · line 973 · raw

@+rb:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @has:Bool -> String

a request body's media type, "" for none

def op source · line 982 · raw

@+doc:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @+path:String -> @+method:String -> @ips:List<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json> -> @+oper:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Op

one operation of a Path Item at path, oper its Operation Object, its references followed in doc, after the Path Item's parameters ips

def item.at source · line 999 · raw

@hit:Bool -> @+doc:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @+path:String -> @+method:String -> @+ips:List<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json> -> @+oper:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @rest:List<&2, Op> -> List<&2, Op>

def item source · line 1016 · raw

@ms:List<&2, String> -> @+doc:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @+path:String -> @+it:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @+ips:List<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json> -> List<&2, Op>

a Path Item's operations for the methods ms, in their order: one for each method whose member is an object (op), none for any other

def paths source · line 1033 · raw

@ps:List<&2, Mem> -> @+doc:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> List<&2, Op>

the operations of the Path Items ps, in order, each one's in the order of methods, after its parameters with their references followed

def ops source · line 1043 · raw

@+doc:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> List<&2, Op>

every operation of a document, in the order of its paths (paths)

def tool source · line 1047 · raw

@oper:Op -> 0x836cb96670527cb1735ff34e6a518b02/src/server.ToolSpec

an operation's tool

def name source · line 1053 · raw

@oper:Op -> String

an operation's tool name

def renamed source · line 1059 · raw

@oper:Op -> @to:String -> Op

an operation under another tool name, all else as it was

def arg.at source · line 1066 · raw

@has:Bool -> @+val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Maybe<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json>

def arg source · line 1074 · raw

@+args:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @+name:String -> Maybe<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json>

an argument's value when it is there and not null

def plain.scalar source · line 1077 · raw

@val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> String

def plain.item source · line 1092 · raw

@val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> String

def plain.items source · line 1099 · raw

@items:List<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json> -> List<&2, String>

def plain source · line 1109 · raw

@val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> String

a value as the text of a parameter: a string as itself, a number as its text, a boolean as true or false, an array as its items' texts joined by , (style simple), anything else as its JSON

def swap.at source · line 1116 · raw

@hit:Bool -> @+text:String -> @+pat:String -> @rep:String -> @more:(@_:Unit -> String) -> String

def swap source · line 1130 · raw

@text:String -> @+pat:String -> @+rep:String -> String

a string with its first pat replaced by rep

def fill source · line 1140 · raw

@path:String -> @+name:String -> @val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> String

a path template with its first {name} replaced by the value's text, percent-encoded as a path segment

def query.item source · line 1143 · raw

@+name:String -> @val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> List<&2, 0x7367809738fddd234b8d2bed772ad2cf/src/qs.Kv>

def query.items source · line 1150 · raw

@+name:String -> @items:List<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json> -> List<&2, 0x7367809738fddd234b8d2bed772ad2cf/src/qs.Kv>

def query source · line 1159 · raw

@+name:String -> @val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> List<&2, 0x7367809738fddd234b8d2bed772ad2cf/src/qs.Kv>

a query parameter's pairs: one for each item of an array that is not null, else one of the value's text (style form, explode true)

def req.put.at source · line 1175 · raw

@place:Place -> @+name:String -> @val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @path:String -> @pairs:List<&2, 0x7367809738fddd234b8d2bed772ad2cf/src/qs.Kv> -> @hs:List<&2, 0x7367809738fddd234b8d2bed772ad2cf/src/http.Header> -> Req

a parameter's value put in a request: a path parameter filled into the path (fill), a query parameter's pairs added to the query (query), a header parameter a header field of its name in lower case and its text (plain); a cookie parameter, or one of no known location, changes nothing

def req.put source · line 1196 · raw

@place:Place -> @+name:String -> @val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @sofar:Req -> Req

def req.arg source · line 1201 · raw

@got:Maybe<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json> -> @place:Place -> @+name:String -> @sofar:Req -> Req

def req.params source · line 1215 · raw

@ps:List<&2, Param> -> @+args:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @sofar:Req -> Req

a request with each parameter that has an argument there and not null put in it (req.put), in order

def body.text.of source · line 1222 · raw

@json:Bool -> @val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> String

def body.of source · line 1229 · raw

@+mt:String -> @got:Maybe<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json> -> Maybe<&2, String>

def body.arg source · line 1239 · raw

@none:Bool -> @+mt:String -> @+args:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Maybe<&2, String>

a request's body: the requestBody argument, when the operation has a body and the argument is there and not null, as JSON for application/json, else a string as itself and anything else as its JSON

def ctype source · line 1247 · raw

@+mt:String -> @body:Maybe<&2, String> -> List<&2, 0x7367809738fddd234b8d2bed772ad2cf/src/http.Header>

the header field naming a body's media type, when there is a body

def query.text source · line 1255 · raw

@pairs:List<&2, 0x7367809738fddd234b8d2bed772ad2cf/src/qs.Kv> -> String

a query string: none for no pairs, else ? and the pairs form-encoded

def call.send source · line 1263 · raw

@unfilled:Bool -> @method:String -> @+mt:String -> @+body:Maybe<&2, String> -> @path:String -> @pairs:List<&2, 0x7367809738fddd234b8d2bed772ad2cf/src/qs.Kv> -> @hs:List<&2, 0x7367809738fddd234b8d2bed772ad2cf/src/http.Header> -> Call

the request built, or the path when a template expression is still in it

def call.of source · line 1279 · raw

@method:String -> @+mt:String -> @+body:Maybe<&2, String> -> @built:Req -> Call

def call source · line 1294 · raw

@oper:Op -> @+args:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Call

the request a call of an operation stands for, with these arguments: each parameter with an argument there and not null put in the request (req.params), the header fields Accept: application/json, then the header parameters', then Content-Type when there is a body (body.arg); or Unfilled when the path still holds a {

def digits source · line 1303 · raw

@text:String -> Bool

whether every character is a digit

def int.text source · line 1311 · raw

@text:String -> Bool

whether a number's text is an integer: an optional -, then digits

def kind.int source · line 1320 · raw

@val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Bool

def kind.str source · line 1327 · raw

@val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Bool

def kind.num source · line 1336 · raw

@val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Bool

def kind.bool source · line 1343 · raw

@val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Bool

def kind.name source · line 1351 · raw

@val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> String

the JSON type of a value, as JSON Schema names it

def kind source · line 1373 · raw

@+typ:String -> @+val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Bool

whether a value is of the JSON Schema type named typ: string, number, integer (a number whose text is an integer), boolean, array, object or null; true for a name JSON Schema does not have

def kinds source · line 1384 · raw

@types:List<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json> -> @+val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Bool

whether a value is of one of the types an array of names lists

def typed source · line 1394 · raw

@typ:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @+val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Bool

whether a value is of a schema's type: the type it names, or one of the types an array of names lists; true for a schema with no type

def alts source · line 1406 · raw

@choices:List<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json> -> @+val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Bool

whether a value is of one of the anyOf alternatives' types

def same.json source · line 1413 · raw

@+val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @items:List<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json> -> Bool

def fits source · line 1424 · raw

@+sch:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @+val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Bool

whether a value fits a property's schema, one level deep: its type (typed), one of its anyOf alternatives' types when it has anyOf, and one of its enum values when it has enum

def missing.at source · line 1431 · raw

@has:Bool -> @name:String -> @more:(@_:Unit -> Maybe<&2, String>) -> Maybe<&2, String>

def missing source · line 1443 · raw

@req:List<&2, 0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json> -> @+args:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Maybe<&2, String>

what the first required name the arguments do not have is missing

def wanted.of source · line 1451 · raw

@typ:Maybe<&2, String> -> @val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> String

def wanted source · line 1460 · raw

@sch:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> String

what is wrong with a value that does not fit its schema: the type it should have had, when the schema names one, and the type it has

def bad.at source · line 1463 · raw

@ok:Bool -> @name:String -> @sch:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @val:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> @more:(@_:Unit -> Maybe<&2, String>) -> Maybe<&2, String>

def bad source · line 1478 · raw

@ps:List<&2, Mem> -> @+args:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Maybe<&2, String>

what is wrong with the first property whose argument is there and does not fit its schema (fits)

def check.of source · line 1486 · raw

@name:String -> @why:Maybe<&2, String> -> Maybe<&2, String>

def check source · line 1496 · raw

@oper:Op -> @+args:0xa81e161008ecc2f297c0a3065cb9b188/src/value.Json -> Maybe<&2, String>

what is wrong with a call's arguments, when anything is: a required name they do not have (missing), else a property they have whose value does not fit its schema (bad); none when neither