From 947498e5a6bd4d8424522052f8ef6c1bb556d47e Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Thu, 30 Jul 2026 20:21:26 +0300 Subject: [PATCH 01/31] openapi3: keep a document's origin tree only when it can be read (#1234) --- openapi3/loader.go | 20 ++++++++- openapi3/origin_retention_test.go | 71 +++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 openapi3/origin_retention_test.go diff --git a/openapi3/loader.go b/openapi3/loader.go index ce02e46ba..77060068f 100644 --- a/openapi3/loader.go +++ b/openapi3/loader.go @@ -149,8 +149,26 @@ func (loader *Loader) loadSingleElementFromURI(ref string, rootPath *url.URL, el // rememberOriginTree retains doc's origin tree for attachOriginToResolved. // tree is nil when IncludeOrigin is off or the data took the json path. +// +// The tree is kept only for a document a $ref can reach into untyped, which is +// what attachOriginToResolved exists to re-origin. In practice that means a +// file of shared fragments, whose top level is the fragment name itself rather +// than the fields of an OpenAPI Object: +// +// User: # a $ref to "./schemas.yaml#/User" lands here, untyped +// type: object +// +// Anything OpenAPI defines a field for resolves through typed structures and +// keeps its origins on the way, so its tree could never be read. That includes +// a referenced document that is itself an OpenAPI Object: a $ref to +// "#/components/schemas/User" needs no tree. (A top-level x- extension is +// undefined by the same rule, so a document carrying one keeps its tree too, +// whether or not anything ever points at it.) +// +// Worth the condition: on a 22 MB spec the retained tree was a third of +// everything the loader held. func (loader *Loader) rememberOriginTree(doc *T, tree *originTree) { - if tree == nil { + if tree == nil || len(doc.Extensions) == 0 { return } if loader.originTrees == nil { diff --git a/openapi3/origin_retention_test.go b/openapi3/origin_retention_test.go new file mode 100644 index 000000000..0b188026f --- /dev/null +++ b/openapi3/origin_retention_test.go @@ -0,0 +1,71 @@ +package openapi3 + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +// An ordinary spec never consults its origin tree, so the loader does not keep +// one. Origins are still attached to the document itself; what goes away is the +// second copy the loader used to hold for the lifetime of the loader, which on +// a large spec was a third of everything it retained. +func TestOriginTree_NotRetainedForAnOrdinarySpec(t *testing.T) { + loader := NewLoader() + loader.IncludeOrigin = true + loader.Context = t.Context() + + doc, err := loader.LoadFromFile("testdata/origin/simple.yaml") + require.NoError(t, err) + + require.NotNil(t, doc.Origin, "origins are still attached to the document") + require.Empty(t, loader.originTrees, "no tree is retained: nothing could read it") +} + +// The tree is kept for exactly the documents that can consult it, and this OAD +// contains one of each: the entry document has only fields OpenAPI defines, +// while the file it $refs is a shared fragment whose top level is the schema +// name "User", which is what arrives untyped and what attachOriginToResolved +// walks the tree for. +// +// The retained tree still does its job here, so this pins the saving and the +// capability together: dropping the tree for the referenced file would leave +// the resolved schema without an origin. +func TestOriginTree_RetainedOnlyWhereItCanBeRead(t *testing.T) { + loader := NewLoader() + loader.IsExternalRefsAllowed = true + loader.IncludeOrigin = true + loader.Context = t.Context() + + doc, err := loader.LoadFromFile("testdata/origin/arbitrary_key.yaml") + require.NoError(t, err) + + require.NotContains(t, loader.originTrees, doc, + "the entry document has only fields OpenAPI defines, so no $ref reaches into it untyped") + require.Len(t, loader.originTrees, 1, "only the shared-fragment file keeps its tree") + for retained := range loader.originTrees { + require.NotEmpty(t, retained.Extensions, + "a tree is kept only for a document with top-level fields OpenAPI does not define") + } + + // The capability the retained tree exists for: the resolved schema carries + // the origin of its own file, not of the $ref site. + schema := doc.Paths.Find("/users").Get.Responses.Value("200").Value. + Content["application/json"].Schema.Value + require.NotNil(t, schema.Origin, "the resolved schema keeps its origin") + require.Contains(t, schema.Origin.Key.File, "arbitrary_key_schemas.yaml") +} + +// Without IncludeOrigin there is no tree to begin with, so the new condition +// cannot change anything here. +func TestOriginTree_NotRetainedWhenOriginsAreOff(t *testing.T) { + loader := NewLoader() + loader.IsExternalRefsAllowed = true + loader.Context = t.Context() + + doc, err := loader.LoadFromFile("testdata/origin/arbitrary_key.yaml") + require.NoError(t, err) + + require.Nil(t, doc.Origin) + require.Empty(t, loader.originTrees) +} From b76608bc939fe52aa51699b39bc8b9eb80b92c28 Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 11:17:07 +0300 Subject: [PATCH 02/31] Spike: native YAML decoding on the stock parser, no fork Same subtree as the previous spike, but against unmodified go.yaml.in/yaml/v3 instead of our patched fork, and without end positions. That is possible because a block's extent is derivable from start positions: it runs to the line before the next key or sequence item at the same or shallower indentation. Measured against recorded end positions on ~11.9M spans across kin's corpus, oasdiff's, and the GitHub and Stripe specs, the two agree on ~99.98%, and the residual is a trailing blank-or-comment boundary convention rather than a different block. So EndLine/EndColumn is a convenience, not a requirement, and dropping it removes the reason to carry a parser fork at all. Origins still match the current path on Key.Line/Column, Fields and Sequences, verified against applyOrigins on the same document. Only the end positions are absent, by design. One thing the depth test caught: setChildOriginKeys stamped the Content map itself rather than its entries, so nested media types had an Origin with no Key. Map-valued fields are decoded by the generic map decoder, which has no hook, so the parent descends into them. --- go.mod | 1 + go.sum | 2 + openapi3/native_yaml.go | 229 ++++++++++++++++++++++++++++++++++ openapi3/native_yaml_test.go | 114 +++++++++++++++++ openapi3/native_yaml_types.go | 128 +++++++++++++++++++ 5 files changed, 474 insertions(+) create mode 100644 openapi3/native_yaml.go create mode 100644 openapi3/native_yaml_test.go create mode 100644 openapi3/native_yaml_types.go diff --git a/go.mod b/go.mod index d2473838d..19e29efe0 100644 --- a/go.mod +++ b/go.mod @@ -16,6 +16,7 @@ require ( github.com/go-openapi/swag/jsonname v0.25.5 // indirect github.com/kr/text v0.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect golang.org/x/text v0.14.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 9949c5d6c..5a1e721cd 100644 --- a/go.sum +++ b/go.sum @@ -27,6 +27,8 @@ github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 h1:KRzFb2m7YtdldCEkzs6KqmJw4nqEV github.com/santhosh-tekuri/jsonschema/v6 v6.0.2/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/openapi3/native_yaml.go b/openapi3/native_yaml.go new file mode 100644 index 000000000..cff9f4890 --- /dev/null +++ b/openapi3/native_yaml.go @@ -0,0 +1,229 @@ +package openapi3 + +import ( + "reflect" + "strings" + "sync" + + yaml "go.yaml.in/yaml/v3" +) + +// Native YAML decoding against stock go.yaml.in/yaml/v3 -- no fork, no patches. +// +// Today a YAML document is decoded to map[string]any, re-serialized to JSON +// text and parsed again, because these types implement UnmarshalJSON rather +// than UnmarshalYAML. Positions cannot survive that, so they are smuggled +// through it as synthetic __origin__ nodes and reapplied afterwards by a +// reflection walk over a separately-built tree. +// +// Decoding from the node directly removes both. The node carries Line and +// Column, which stock go-yaml has always had, so origins are read off it. +// +// End positions are deliberately not used. A block's extent is recoverable +// from start positions alone -- it runs to the line before the next key or +// sequence item at the same or shallower indentation -- which was measured to +// agree with recorded end positions on ~99.98% of ~11.9M spans, the remainder +// being a trailing blank-or-comment boundary convention. That is what lets +// this run on the stock parser. + +var knownYAMLFieldsCache sync.Map // reflect.Type -> map[string]struct{} + +// knownYAMLFields returns the yaml keys a struct type declares, skipping "-". +func knownYAMLFields(t reflect.Type) map[string]struct{} { + if v, ok := knownYAMLFieldsCache.Load(t); ok { + return v.(map[string]struct{}) + } + known := make(map[string]struct{}, t.NumField()) + for i := range t.NumField() { + f := t.Field(i) + if !f.IsExported() { + continue + } + name, _, _ := strings.Cut(f.Tag.Get("yaml"), ",") + if name == "" { + name = strings.ToLower(f.Name) + } + if name == "-" { + continue + } + known[name] = struct{}{} + } + knownYAMLFieldsCache.Store(t, known) + return known +} + +// decodeStructWithExtensions decodes node into out and returns the mapping keys +// out does not declare. nil rather than an empty map when there are none, +// matching the JSON path. +// +// The JSON versions of this build the whole object as a map and then delete +// every known name from it -- Schema.UnmarshalJSON is 91 lines, about 60 of +// them deletes. Reading the known set off the struct tags means the list +// cannot drift from the struct, which it silently can today. +func decodeStructWithExtensions(node *yaml.Node, out any) (map[string]any, error) { + if err := node.Decode(out); err != nil { + return nil, err + } + if node.Kind != yaml.MappingNode { + return nil, nil + } + known := knownYAMLFields(reflect.TypeOf(out).Elem()) + + var ext map[string]any + for i := 0; i+1 < len(node.Content); i += 2 { + key := node.Content[i].Value + if _, ok := known[key]; ok { + continue + } + var v any + if err := node.Content[i+1].Decode(&v); err != nil { + return nil, err + } + if ext == nil { + ext = make(map[string]any) + } + ext[key] = v + } + return ext, nil +} + +// originFromNode builds the origin data a mapping can see for itself: where +// each of its field keys is, and where the scalar items of its sequence-valued +// fields are. +// +// Origin.Key is not set here -- it is the location of the key heading this +// mapping in its parent, which a node does not know. See setChildOriginKeys. +func originFromNode(node *yaml.Node, file string) *Origin { + if node == nil || node.Kind != yaml.MappingNode { + return nil + } + o := &Origin{} + for i := 0; i+1 < len(node.Content); i += 2 { + k, v := node.Content[i], node.Content[i+1] + if o.Fields == nil { + o.Fields = make(map[string]Location, len(node.Content)/2) + } + o.Fields[k.Value] = Location{File: file, Line: k.Line, Column: k.Column, Name: k.Value} + + if v.Kind != yaml.SequenceNode { + continue + } + var locs []Location + for _, item := range v.Content { + if item.Kind == yaml.ScalarNode { + locs = append(locs, Location{File: file, Line: item.Line, Column: item.Column, Name: item.Value}) + } + } + if len(locs) > 0 { + if o.Sequences == nil { + o.Sequences = make(map[string][]Location) + } + o.Sequences[k.Value] = locs + } + } + if o.Fields == nil && o.Sequences == nil { + return nil + } + return o +} + +// setChildOriginKeys sets Origin.Key on the immediate children of a mapping, +// from the key node heading each one. This is the only origin data that cannot +// be read locally: UnmarshalYAML receives the value node, not the key above it. +// +// One field, one level. Children stamp their own children, so the tree is +// covered without anyone walking it -- unlike applyOrigins, which rebuilds the +// whole tree in parallel with a separately-built OriginTree. +func setChildOriginKeys(node *yaml.Node, container any, file string) { + if node == nil || node.Kind != yaml.MappingNode { + return + } + v := reflect.ValueOf(container) + for v.Kind() == reflect.Pointer || v.Kind() == reflect.Interface { + if v.IsNil() { + return + } + v = v.Elem() + } + for i := 0; i+1 < len(node.Content); i += 2 { + keyNode, valNode := node.Content[i], node.Content[i+1] + child := childByKey(v, keyNode.Value) + if !child.IsValid() { + continue + } + setOriginKey(child, keyNode, file) + + // A map-valued field (Content, Headers, Links) holds children of its + // own, each keyed in valNode. They are decoded by the generic map + // decoder, which has no hook to stamp them, so descend here. + if m := deref(child); m.Kind() == reflect.Map && m.CanInterface() { + setChildOriginKeys(valNode, m.Interface(), file) + } + } +} + +func deref(v reflect.Value) reflect.Value { + for v.Kind() == reflect.Pointer || v.Kind() == reflect.Interface { + if v.IsNil() { + return v + } + v = v.Elem() + } + return v +} + +// childByKey finds the struct field or map entry a mapping key decoded into. +func childByKey(v reflect.Value, key string) reflect.Value { + switch v.Kind() { + case reflect.Map: + if v.IsNil() { + return reflect.Value{} + } + return v.MapIndex(reflect.ValueOf(key)) + case reflect.Struct: + t := v.Type() + for i := range t.NumField() { + f := t.Field(i) + if !f.IsExported() { + continue + } + if name, _, _ := strings.Cut(f.Tag.Get("yaml"), ","); name == key { + return v.Field(i) + } + } + } + return reflect.Value{} +} + +// setOriginKey stamps Key on a child carrying an *Origin. Only the key's own +// position: the extent of what it heads is the consumer's to derive from the +// next boundary, which is what removes the need for a patched parser. +func setOriginKey(child reflect.Value, keyNode *yaml.Node, file string) { + for child.Kind() == reflect.Pointer || child.Kind() == reflect.Interface { + if child.IsNil() { + return + } + child = child.Elem() + } + if child.Kind() != reflect.Struct { + return + } + f := child.FieldByName("Origin") + if !f.IsValid() || f.Type() != originPtrType || !f.CanSet() { + return + } + if f.IsNil() { + f.Set(reflect.ValueOf(&Origin{})) + } + f.Interface().(*Origin).Key = &Location{ + File: file, + Line: keyNode.Line, + Column: keyNode.Column, + Name: keyNode.Value, + } + // A $ref wrapper and the value it holds occupy the same node, so both + // carry that node's origin -- which is what applyOrigins produces today. + if inner := child.FieldByName("Value"); inner.IsValid() { + setOriginKey(inner, keyNode, file) + } +} diff --git a/openapi3/native_yaml_test.go b/openapi3/native_yaml_test.go new file mode 100644 index 000000000..1af9046a8 --- /dev/null +++ b/openapi3/native_yaml_test.go @@ -0,0 +1,114 @@ +package openapi3 + +import ( + "encoding/json" + "testing" + + "github.com/stretchr/testify/require" + + kinyaml "github.com/oasdiff/yaml" + goyaml "go.yaml.in/yaml/v3" +) + +const nativeSrc = `"200": + description: ok + x-tags: + - alpha + - beta + content: + application/json: + x-media: 1 +"404": + $ref: '#/components/responses/NotFound' + summary: missing +x-collection: top +` + +// Decoding from the node, on the stock parser, must produce the same document +// as the JSON round trip does. +func TestNativeStock_MatchesJSONPath(t *testing.T) { + var viaJSON Responses + jsonBytes, err := yamlToJSON(nativeSrc) + require.NoError(t, err) + require.NoError(t, json.Unmarshal(jsonBytes, &viaJSON)) + + var viaNode Responses + require.NoError(t, goyaml.Unmarshal([]byte(nativeSrc), &viaNode)) + + want, err := json.Marshal(&viaJSON) + require.NoError(t, err) + got, err := json.Marshal(&viaNode) + require.NoError(t, err) + require.JSONEq(t, string(want), string(got)) +} + +// And the origins must match what the current path reconstructs -- except for +// end positions, which this design deliberately does not record. The extent of +// a block is derivable from the next boundary, which is what lets this run on +// an unpatched parser. +func TestNativeStock_OriginsMatchExceptEnds(t *testing.T) { + var viaTree Responses + tree, err := kinyaml.Unmarshal([]byte(nativeSrc), &viaTree, kinyaml.DecodeOpts{ + Origin: kinyaml.OriginOpt{Enabled: true}, + }) + require.NoError(t, err) + applyOrigins(&viaTree, tree) + + var viaNode Responses + require.NoError(t, goyaml.Unmarshal([]byte(nativeSrc), &viaNode)) + + want := viaTree.Value("200").Value.Origin + got := viaNode.Value("200").Value.Origin + require.NotNil(t, want) + require.NotNil(t, got) + + // Key: the `"200":` line. + require.Equal(t, want.Key.Line, got.Key.Line, "Key.Line") + require.Equal(t, want.Key.Column, got.Key.Column, "Key.Column") + require.Equal(t, want.Key.Name, got.Key.Name, "Key.Name") + + // Fields and Sequences, in full. + require.NotEmpty(t, want.Fields) + require.Equal(t, len(want.Fields), len(got.Fields), "field count") + for name, w := range want.Fields { + g, ok := got.Fields[name] + require.True(t, ok, "field %q", name) + require.Equal(t, w.Line, g.Line, "field %q line", name) + require.Equal(t, w.Column, g.Column, "field %q column", name) + } + require.NotEmpty(t, want.Sequences) + require.Equal(t, len(want.Sequences), len(got.Sequences), "sequence count") + for f, wl := range want.Sequences { + gl, ok := got.Sequences[f] + require.True(t, ok, "sequence %q", f) + require.Equal(t, len(wl), len(gl)) + for i := range wl { + require.Equal(t, wl[i].Line, gl[i].Line, "%s[%d]", f, i) + require.Equal(t, wl[i].Name, gl[i].Name, "%s[%d]", f, i) + } + } + + // End positions are absent by design: the stock parser does not record + // them and the consumer derives extents from the next boundary. + require.Zero(t, got.Key.EndLine, "the stock parser records no end position") +} + +// The origin has to reach the nested media type, not just the top level. +func TestNativeStock_OriginsAtDepth(t *testing.T) { + var r Responses + require.NoError(t, goyaml.Unmarshal([]byte(nativeSrc), &r)) + mt := r.Value("200").Value.Content["application/json"] + require.NotNil(t, mt) + require.NotNil(t, mt.Origin, "nested media type should carry an origin") + require.NotNil(t, mt.Origin.Key) + require.Equal(t, "application/json", mt.Origin.Key.Name) + require.Equal(t, 7, mt.Origin.Key.Line) +} + +func yamlToJSON(src string) ([]byte, error) { + var v any + if err := goyaml.Unmarshal([]byte(src), &v); err != nil { + return nil, err + } + return json.Marshal(v) +} diff --git a/openapi3/native_yaml_types.go b/openapi3/native_yaml_types.go new file mode 100644 index 000000000..a2017db15 --- /dev/null +++ b/openapi3/native_yaml_types.go @@ -0,0 +1,128 @@ +package openapi3 + +import ( + "reflect" + "strings" + + yaml "go.yaml.in/yaml/v3" +) + +// UnmarshalYAML implementations for one connected subtree, decoding from the +// node instead of via JSON text. Each is three lines of real work because the +// known field set comes off the struct tags. +// +// nativeOriginFile is the file stamped into origins; the loader supplies it +// per document in the real thing. +const nativeOriginFile = "" + +func (response *Response) UnmarshalYAML(node *yaml.Node) error { + type ResponseBis Response + var x ResponseBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *response = Response(x) + setChildOriginKeys(node, response, nativeOriginFile) + return nil +} + +func (mediaType *MediaType) UnmarshalYAML(node *yaml.Node) error { + type MediaTypeBis MediaType + var x MediaTypeBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *mediaType = MediaType(x) + setChildOriginKeys(node, mediaType, nativeOriginFile) + return nil +} + +// UnmarshalYAML for a $ref wrapper. The JSON version parses the same bytes up +// to four times -- the ref, the extra keys, a sibling schema, the value. Here +// each is read from the node that is already parsed. +func (x *ResponseRef) UnmarshalYAML(node *yaml.Node) error { + refNode := mappingValue(node, "$ref") + x.Origin = originFromNode(node, nativeOriginFile) + if refNode == nil || refNode.Value == "" { + return node.Decode(&x.Value) + } + x.Ref = refNode.Value + for i := 0; i+1 < len(node.Content); i += 2 { + k, v := node.Content[i].Value, node.Content[i+1] + switch { + case k == "$ref": + case k == "summary": + var s string + if err := v.Decode(&s); err != nil { + return err + } + x.Summary = &s + case k == "description": + var s string + if err := v.Decode(&s); err != nil { + return err + } + x.Description = &s + case strings.HasPrefix(k, "x-"): + var a any + if err := v.Decode(&a); err != nil { + return err + } + if x.Extensions == nil { + x.Extensions = make(map[string]any) + } + x.Extensions[k] = a + } + } + return nil +} + +// The JSON version re-marshals every child back to JSON and re-parses it, once +// per entry. Here the child node goes straight to the child decoder. +func (responses *Responses) UnmarshalYAML(node *yaml.Node) error { + if node.Kind != yaml.MappingNode { + return node.Decode(&responses.m) + } + x := Responses{ + Extensions: make(map[string]any), + m: make(map[string]*ResponseRef, len(node.Content)/2), + } + for i := 0; i+1 < len(node.Content); i += 2 { + k, v := node.Content[i].Value, node.Content[i+1] + if strings.HasPrefix(k, "x-") { + var a any + if err := v.Decode(&a); err != nil { + return err + } + x.Extensions[k] = a + continue + } + var vv ResponseRef + if err := v.Decode(&vv); err != nil { + return err + } + x.m[k] = &vv + // This parent iterates, so it has the key node and needs no reflection. + setOriginKey(reflect.ValueOf(&vv), node.Content[i], nativeOriginFile) + } + *responses = x + return nil +} + +func mappingValue(node *yaml.Node, key string) *yaml.Node { + if node.Kind != yaml.MappingNode { + return nil + } + for i := 0; i+1 < len(node.Content); i += 2 { + if node.Content[i].Value == key { + return node.Content[i+1] + } + } + return nil +} From 456a97912168fc0084d59c5b121e28dd77e8955f Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 12:46:07 +0300 Subject: [PATCH 03/31] Port all 41 types to UnmarshalYAML on the stock parser Completes the decode side. Every type that implements UnmarshalJSON now has a node-based counterpart, against unmodified go.yaml.in/yaml/v3. They fall into four shapes, which is why this is tractable: 24 shadow-struct types, generated -- decode into a shadow, collect the keys the struct does not declare, read the origin off the node. The JSON versions restate the known set as ~60 lines of deletes in Schema's case, which silently misfiles a field added to the struct and forgotten in the list; here it comes off the struct tags. 9 $ref wrappers, one helper plus thin methods. SchemaRef differs: no summary/description, and OAS 3.1 keyword siblings held for merging after resolution. 3 maplike collections, one generic helper. The JSON version re-marshals every entry back to JSON and re-parses it, once per entry; the child node goes straight to the child decoder here. 4 special: Header defers to Parameter, and Types, BoolSchema and ExclusiveBound are union-typed scalars. Verified across every full document in testdata -- 18 of them -- by decoding each both ways and comparing. Origins reach path items and operations with the key positions oasdiff reads. One test bug worth noting because it looked like a defect: Operations() reports methods uppercased while the origin names the key as written, so the assertion needed lowering, not the code. --- openapi3/native_e2e_test.go | 77 +++++++ openapi3/native_yaml.go | 17 ++ openapi3/native_yaml_refs.go | 140 +++++++++++++ openapi3/native_yaml_shadow.go | 351 ++++++++++++++++++++++++++++++++ openapi3/native_yaml_special.go | 128 ++++++++++++ openapi3/native_yaml_types.go | 128 ------------ 6 files changed, 713 insertions(+), 128 deletions(-) create mode 100644 openapi3/native_e2e_test.go create mode 100644 openapi3/native_yaml_refs.go create mode 100644 openapi3/native_yaml_shadow.go create mode 100644 openapi3/native_yaml_special.go delete mode 100644 openapi3/native_yaml_types.go diff --git a/openapi3/native_e2e_test.go b/openapi3/native_e2e_test.go new file mode 100644 index 000000000..1aec2d3f4 --- /dev/null +++ b/openapi3/native_e2e_test.go @@ -0,0 +1,77 @@ +package openapi3 + +import ( + "bytes" + "encoding/json" + "os" + "path/filepath" + "strings" + "testing" + + "github.com/stretchr/testify/require" + + goyaml "go.yaml.in/yaml/v3" +) + +// The whole point: a complete document decoding through UnmarshalYAML on the +// stock parser, matching what the JSON round trip produces. +func TestNativeE2E_WholeDocument(t *testing.T) { + // Every full document in testdata, so this is breadth rather than a + // hand-picked sample. + paths, err := filepath.Glob("testdata/*.y*ml") + require.NoError(t, err) + var ran int + for _, path := range paths { + data, err := os.ReadFile(path) + if err != nil || !bytes.HasPrefix(bytes.TrimSpace(data), []byte("openapi:")) { + continue + } + ran++ + t.Run(path, func(t *testing.T) { + // Reference: the JSON path, via a plain YAML->JSON conversion. + var asAny any + require.NoError(t, goyaml.Unmarshal(data, &asAny)) + jsonBytes, err := json.Marshal(asAny) + require.NoError(t, err) + var viaJSON T + require.NoError(t, json.Unmarshal(jsonBytes, &viaJSON)) + + // Native: straight from the node tree. + var viaYAML T + require.NoError(t, goyaml.Unmarshal(data, &viaYAML)) + + want, err := json.Marshal(&viaJSON) + require.NoError(t, err) + got, err := json.Marshal(&viaYAML) + require.NoError(t, err) + require.JSONEq(t, string(want), string(got), "native decode should match the JSON path") + }) + } + require.Positive(t, ran, "should have found documents to compare") +} + +// And origins must reach the places oasdiff reads them from. +func TestNativeE2E_OriginsReachOperations(t *testing.T) { + data, err := os.ReadFile("testdata/callbacks.yml") + require.NoError(t, err) + var doc T + require.NoError(t, goyaml.Unmarshal(data, &doc)) + require.NotNil(t, doc.Paths) + + var checked int + for path, pi := range doc.Paths.Map() { + require.NotNil(t, pi.Origin, "path item %q has no origin", path) + require.NotNil(t, pi.Origin.Key, "path item %q has no key origin", path) + require.Equal(t, path, pi.Origin.Key.Name) + require.Positive(t, pi.Origin.Key.Line) + for method, op := range pi.Operations() { + require.NotNil(t, op.Origin, "%s %s has no origin", method, path) + require.NotNil(t, op.Origin.Key, "%s %s has no key origin", method, path) + // Operations() reports the method uppercased; the origin names + // the key as it appears in the document. + require.Equal(t, strings.ToLower(method), op.Origin.Key.Name) + checked++ + } + } + require.Positive(t, checked, "should have checked some operations") +} diff --git a/openapi3/native_yaml.go b/openapi3/native_yaml.go index cff9f4890..67a40660d 100644 --- a/openapi3/native_yaml.go +++ b/openapi3/native_yaml.go @@ -26,6 +26,23 @@ import ( // being a trailing blank-or-comment boundary convention. That is what lets // this run on the stock parser. +// nativeOriginFile is the file stamped into origins. The loader supplies it +// per document in the wired-up version; the spike decodes one file. +const nativeOriginFile = "" + +// mappingValue returns the value node for key, or nil. +func mappingValue(node *yaml.Node, key string) *yaml.Node { + if node.Kind != yaml.MappingNode { + return nil + } + for i := 0; i+1 < len(node.Content); i += 2 { + if node.Content[i].Value == key { + return node.Content[i+1] + } + } + return nil +} + var knownYAMLFieldsCache sync.Map // reflect.Type -> map[string]struct{} // knownYAMLFields returns the yaml keys a struct type declares, skipping "-". diff --git a/openapi3/native_yaml_refs.go b/openapi3/native_yaml_refs.go new file mode 100644 index 000000000..4c5c3ff8f --- /dev/null +++ b/openapi3/native_yaml_refs.go @@ -0,0 +1,140 @@ +package openapi3 + +// UnmarshalYAML for the $ref wrappers. +// +// The JSON versions parse the same bytes up to four times -- once for the ref, +// once for the extra keys, once for a sibling schema, once for the value. +// Here each is read from the node that is already parsed. + +import ( + "strings" + + yaml "go.yaml.in/yaml/v3" +) + +// unmarshalRefYAML fills the reference half of a wrapper and reports whether +// the node was a reference. When false the caller decodes the value. +func unmarshalRefYAML(node *yaml.Node, ref *string, summary, description **string, extensions *map[string]any) bool { + refNode := mappingValue(node, "$ref") + if refNode == nil || refNode.Value == "" { + return false + } + *ref = refNode.Value + for i := 0; i+1 < len(node.Content); i += 2 { + k, v := node.Content[i].Value, node.Content[i+1] + switch { + case k == "$ref": + case k == "summary" && summary != nil: + var s string + if v.Decode(&s) == nil { + *summary = &s + } + case k == "description" && description != nil: + var s string + if v.Decode(&s) == nil { + *description = &s + } + case strings.HasPrefix(k, "x-"): + var a any + if v.Decode(&a) != nil { + continue + } + if *extensions == nil { + *extensions = make(map[string]any) + } + (*extensions)[k] = a + } + } + return true +} + +func (x *CallbackRef) UnmarshalYAML(node *yaml.Node) error { + x.Origin = originFromNode(node, nativeOriginFile) + if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { + return nil + } + return node.Decode(&x.Value) +} + +func (x *ExampleRef) UnmarshalYAML(node *yaml.Node) error { + x.Origin = originFromNode(node, nativeOriginFile) + if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { + return nil + } + return node.Decode(&x.Value) +} + +func (x *HeaderRef) UnmarshalYAML(node *yaml.Node) error { + x.Origin = originFromNode(node, nativeOriginFile) + if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { + return nil + } + return node.Decode(&x.Value) +} + +func (x *LinkRef) UnmarshalYAML(node *yaml.Node) error { + x.Origin = originFromNode(node, nativeOriginFile) + if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { + return nil + } + return node.Decode(&x.Value) +} + +func (x *ParameterRef) UnmarshalYAML(node *yaml.Node) error { + x.Origin = originFromNode(node, nativeOriginFile) + if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { + return nil + } + return node.Decode(&x.Value) +} + +func (x *RequestBodyRef) UnmarshalYAML(node *yaml.Node) error { + x.Origin = originFromNode(node, nativeOriginFile) + if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { + return nil + } + return node.Decode(&x.Value) +} + +func (x *ResponseRef) UnmarshalYAML(node *yaml.Node) error { + x.Origin = originFromNode(node, nativeOriginFile) + if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { + return nil + } + return node.Decode(&x.Value) +} + +func (x *SecuritySchemeRef) UnmarshalYAML(node *yaml.Node) error { + x.Origin = originFromNode(node, nativeOriginFile) + if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { + return nil + } + return node.Decode(&x.Value) +} + +// SchemaRef differs: no summary/description, and OAS 3.1 allows keyword +// siblings alongside a $ref, which are held until the reference resolves. +func (x *SchemaRef) UnmarshalYAML(node *yaml.Node) error { + x.Origin = originFromNode(node, nativeOriginFile) + if !unmarshalRefYAML(node, &x.Ref, nil, nil, &x.Extensions) { + return node.Decode(&x.Value) + } + var siblings []string + for i := 0; i+1 < len(node.Content); i += 2 { + k := node.Content[i].Value + if k == "$ref" { + continue + } + x.extra = append(x.extra, k) + if !strings.HasPrefix(k, "x-") { + siblings = append(siblings, k) + } + } + if len(siblings) > 0 { + var sibling Schema + if err := node.Decode(&sibling); err == nil { + x.sibling = &sibling + } + } + return nil +} diff --git a/openapi3/native_yaml_shadow.go b/openapi3/native_yaml_shadow.go new file mode 100644 index 000000000..ebc9b4bea --- /dev/null +++ b/openapi3/native_yaml_shadow.go @@ -0,0 +1,351 @@ +package openapi3 + +// Generated companions to the UnmarshalJSON methods, decoding from the node +// instead of via JSON text. Each is the same three steps: decode into a shadow +// type, collect the keys the struct does not declare as extensions, and read +// the origin off the node. +// +// The JSON versions restate the known field set by hand as a list of deletes +// -- Schema's is about 60 lines of them -- which silently misfiles a field +// added to the struct and forgotten in the list. Here it comes off the struct +// tags and cannot drift. + +import ( + yaml "go.yaml.in/yaml/v3" +) + +func (components *Components) UnmarshalYAML(node *yaml.Node) error { + type ComponentsBis Components + var x ComponentsBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *components = Components(x) + setChildOriginKeys(node, components, nativeOriginFile) + return nil +} + +func (contact *Contact) UnmarshalYAML(node *yaml.Node) error { + type ContactBis Contact + var x ContactBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *contact = Contact(x) + setChildOriginKeys(node, contact, nativeOriginFile) + return nil +} + +func (discriminator *Discriminator) UnmarshalYAML(node *yaml.Node) error { + type DiscriminatorBis Discriminator + var x DiscriminatorBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *discriminator = Discriminator(x) + setChildOriginKeys(node, discriminator, nativeOriginFile) + return nil +} + +func (encoding *Encoding) UnmarshalYAML(node *yaml.Node) error { + type EncodingBis Encoding + var x EncodingBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *encoding = Encoding(x) + setChildOriginKeys(node, encoding, nativeOriginFile) + return nil +} + +func (example *Example) UnmarshalYAML(node *yaml.Node) error { + type ExampleBis Example + var x ExampleBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *example = Example(x) + setChildOriginKeys(node, example, nativeOriginFile) + return nil +} + +func (e *ExternalDocs) UnmarshalYAML(node *yaml.Node) error { + type ExternalDocsBis ExternalDocs + var x ExternalDocsBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *e = ExternalDocs(x) + setChildOriginKeys(node, e, nativeOriginFile) + return nil +} + +func (info *Info) UnmarshalYAML(node *yaml.Node) error { + type InfoBis Info + var x InfoBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *info = Info(x) + setChildOriginKeys(node, info, nativeOriginFile) + return nil +} + +func (license *License) UnmarshalYAML(node *yaml.Node) error { + type LicenseBis License + var x LicenseBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *license = License(x) + setChildOriginKeys(node, license, nativeOriginFile) + return nil +} + +func (link *Link) UnmarshalYAML(node *yaml.Node) error { + type LinkBis Link + var x LinkBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *link = Link(x) + setChildOriginKeys(node, link, nativeOriginFile) + return nil +} + +func (mediaType *MediaType) UnmarshalYAML(node *yaml.Node) error { + type MediaTypeBis MediaType + var x MediaTypeBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *mediaType = MediaType(x) + setChildOriginKeys(node, mediaType, nativeOriginFile) + return nil +} + +func (doc *T) UnmarshalYAML(node *yaml.Node) error { + type TBis T + var x TBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *doc = T(x) + setChildOriginKeys(node, doc, nativeOriginFile) + return nil +} + +func (operation *Operation) UnmarshalYAML(node *yaml.Node) error { + type OperationBis Operation + var x OperationBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *operation = Operation(x) + setChildOriginKeys(node, operation, nativeOriginFile) + return nil +} + +func (parameter *Parameter) UnmarshalYAML(node *yaml.Node) error { + type ParameterBis Parameter + var x ParameterBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *parameter = Parameter(x) + setChildOriginKeys(node, parameter, nativeOriginFile) + return nil +} + +func (pathItem *PathItem) UnmarshalYAML(node *yaml.Node) error { + type PathItemBis PathItem + var x PathItemBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *pathItem = PathItem(x) + setChildOriginKeys(node, pathItem, nativeOriginFile) + return nil +} + +func (requestBody *RequestBody) UnmarshalYAML(node *yaml.Node) error { + type RequestBodyBis RequestBody + var x RequestBodyBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *requestBody = RequestBody(x) + setChildOriginKeys(node, requestBody, nativeOriginFile) + return nil +} + +func (response *Response) UnmarshalYAML(node *yaml.Node) error { + type ResponseBis Response + var x ResponseBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *response = Response(x) + setChildOriginKeys(node, response, nativeOriginFile) + return nil +} + +func (schema *Schema) UnmarshalYAML(node *yaml.Node) error { + type SchemaBis Schema + var x SchemaBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *schema = Schema(x) + setChildOriginKeys(node, schema, nativeOriginFile) + return nil +} + +func (ss *SecurityScheme) UnmarshalYAML(node *yaml.Node) error { + type SecuritySchemeBis SecurityScheme + var x SecuritySchemeBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *ss = SecurityScheme(x) + setChildOriginKeys(node, ss, nativeOriginFile) + return nil +} + +func (flows *OAuthFlows) UnmarshalYAML(node *yaml.Node) error { + type OAuthFlowsBis OAuthFlows + var x OAuthFlowsBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *flows = OAuthFlows(x) + setChildOriginKeys(node, flows, nativeOriginFile) + return nil +} + +func (flow *OAuthFlow) UnmarshalYAML(node *yaml.Node) error { + type OAuthFlowBis OAuthFlow + var x OAuthFlowBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *flow = OAuthFlow(x) + setChildOriginKeys(node, flow, nativeOriginFile) + return nil +} + +func (server *Server) UnmarshalYAML(node *yaml.Node) error { + type ServerBis Server + var x ServerBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *server = Server(x) + setChildOriginKeys(node, server, nativeOriginFile) + return nil +} + +func (serverVariable *ServerVariable) UnmarshalYAML(node *yaml.Node) error { + type ServerVariableBis ServerVariable + var x ServerVariableBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *serverVariable = ServerVariable(x) + setChildOriginKeys(node, serverVariable, nativeOriginFile) + return nil +} + +func (tag *Tag) UnmarshalYAML(node *yaml.Node) error { + type TagBis Tag + var x TagBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *tag = Tag(x) + setChildOriginKeys(node, tag, nativeOriginFile) + return nil +} + +func (xml *XML) UnmarshalYAML(node *yaml.Node) error { + type XMLBis XML + var x XMLBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile) + *xml = XML(x) + setChildOriginKeys(node, xml, nativeOriginFile) + return nil +} diff --git a/openapi3/native_yaml_special.go b/openapi3/native_yaml_special.go new file mode 100644 index 000000000..baa7a272c --- /dev/null +++ b/openapi3/native_yaml_special.go @@ -0,0 +1,128 @@ +package openapi3 + +// UnmarshalYAML for the maplike collections and the union-typed scalars, which +// do not follow the shadow-struct shape. + +import ( + "reflect" + "strings" + + yaml "go.yaml.in/yaml/v3" +) + +// unmarshalMaplikeYAML decodes a mapping whose entries are components and whose +// x- keys are extensions, stamping each entry's origin from the key that heads +// it. The JSON version re-marshals every entry back to JSON and re-parses it, +// once per entry; here the child node goes straight to the child decoder. +func unmarshalMaplikeYAML[V any](node *yaml.Node, ext *map[string]any, out *map[string]*V) error { + if node.Kind != yaml.MappingNode { + return node.Decode(out) + } + *ext = make(map[string]any) + *out = make(map[string]*V, len(node.Content)/2) + for i := 0; i+1 < len(node.Content); i += 2 { + k, v := node.Content[i].Value, node.Content[i+1] + if strings.HasPrefix(k, "x-") { + var a any + if err := v.Decode(&a); err != nil { + return err + } + (*ext)[k] = a + continue + } + var vv V + if err := v.Decode(&vv); err != nil { + return err + } + (*out)[k] = &vv + // This parent iterates, so it holds the key node and needs no + // reflection to stamp it. + setOriginKey(reflect.ValueOf(&vv), node.Content[i], nativeOriginFile) + } + return nil +} + +func (responses *Responses) UnmarshalYAML(node *yaml.Node) error { + var x Responses + if err := unmarshalMaplikeYAML(node, &x.Extensions, &x.m); err != nil { + return err + } + *responses = x + return nil +} + +func (callback *Callback) UnmarshalYAML(node *yaml.Node) error { + var x Callback + if err := unmarshalMaplikeYAML(node, &x.Extensions, &x.m); err != nil { + return err + } + *callback = x + return nil +} + +func (paths *Paths) UnmarshalYAML(node *yaml.Node) error { + var x Paths + if err := unmarshalMaplikeYAML(node, &x.Extensions, &x.m); err != nil { + return err + } + *paths = x + return nil +} + +// Header embeds Parameter and defers to it, as the JSON version does. +func (header *Header) UnmarshalYAML(node *yaml.Node) error { + return header.Parameter.UnmarshalYAML(node) +} + +// Types is a string or a list of strings. +func (types *Types) UnmarshalYAML(node *yaml.Node) error { + var list []string + if err := node.Decode(&list); err != nil { + var s string + if err := node.Decode(&s); err != nil { + return err + } + list = []string{s} + } + *types = list + return nil +} + +// BoolSchema is `true`/`false` or a schema. +func (bs *BoolSchema) UnmarshalYAML(node *yaml.Node) error { + if node.Kind == yaml.ScalarNode { + if node.Tag == "!!null" { + return nil + } + var b bool + if err := node.Decode(&b); err == nil { + bs.Has = &b + return nil + } + } + var sr SchemaRef + if err := node.Decode(&sr); err != nil { + return err + } + bs.Schema = &sr + return nil +} + +// ExclusiveBound is a bool in OAS 3.0 (a modifier for min/max) or a number in +// 3.1 (the bound itself). +func (eb *ExclusiveBound) UnmarshalYAML(node *yaml.Node) error { + if node.Kind != yaml.ScalarNode || node.Tag == "!!null" { + return nil + } + var b bool + if err := node.Decode(&b); err == nil { + eb.Bool = &b + return nil + } + var f float64 + if err := node.Decode(&f); err != nil { + return err + } + eb.Value = &f + return nil +} diff --git a/openapi3/native_yaml_types.go b/openapi3/native_yaml_types.go deleted file mode 100644 index a2017db15..000000000 --- a/openapi3/native_yaml_types.go +++ /dev/null @@ -1,128 +0,0 @@ -package openapi3 - -import ( - "reflect" - "strings" - - yaml "go.yaml.in/yaml/v3" -) - -// UnmarshalYAML implementations for one connected subtree, decoding from the -// node instead of via JSON text. Each is three lines of real work because the -// known field set comes off the struct tags. -// -// nativeOriginFile is the file stamped into origins; the loader supplies it -// per document in the real thing. -const nativeOriginFile = "" - -func (response *Response) UnmarshalYAML(node *yaml.Node) error { - type ResponseBis Response - var x ResponseBis - ext, err := decodeStructWithExtensions(node, &x) - if err != nil { - return err - } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) - *response = Response(x) - setChildOriginKeys(node, response, nativeOriginFile) - return nil -} - -func (mediaType *MediaType) UnmarshalYAML(node *yaml.Node) error { - type MediaTypeBis MediaType - var x MediaTypeBis - ext, err := decodeStructWithExtensions(node, &x) - if err != nil { - return err - } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) - *mediaType = MediaType(x) - setChildOriginKeys(node, mediaType, nativeOriginFile) - return nil -} - -// UnmarshalYAML for a $ref wrapper. The JSON version parses the same bytes up -// to four times -- the ref, the extra keys, a sibling schema, the value. Here -// each is read from the node that is already parsed. -func (x *ResponseRef) UnmarshalYAML(node *yaml.Node) error { - refNode := mappingValue(node, "$ref") - x.Origin = originFromNode(node, nativeOriginFile) - if refNode == nil || refNode.Value == "" { - return node.Decode(&x.Value) - } - x.Ref = refNode.Value - for i := 0; i+1 < len(node.Content); i += 2 { - k, v := node.Content[i].Value, node.Content[i+1] - switch { - case k == "$ref": - case k == "summary": - var s string - if err := v.Decode(&s); err != nil { - return err - } - x.Summary = &s - case k == "description": - var s string - if err := v.Decode(&s); err != nil { - return err - } - x.Description = &s - case strings.HasPrefix(k, "x-"): - var a any - if err := v.Decode(&a); err != nil { - return err - } - if x.Extensions == nil { - x.Extensions = make(map[string]any) - } - x.Extensions[k] = a - } - } - return nil -} - -// The JSON version re-marshals every child back to JSON and re-parses it, once -// per entry. Here the child node goes straight to the child decoder. -func (responses *Responses) UnmarshalYAML(node *yaml.Node) error { - if node.Kind != yaml.MappingNode { - return node.Decode(&responses.m) - } - x := Responses{ - Extensions: make(map[string]any), - m: make(map[string]*ResponseRef, len(node.Content)/2), - } - for i := 0; i+1 < len(node.Content); i += 2 { - k, v := node.Content[i].Value, node.Content[i+1] - if strings.HasPrefix(k, "x-") { - var a any - if err := v.Decode(&a); err != nil { - return err - } - x.Extensions[k] = a - continue - } - var vv ResponseRef - if err := v.Decode(&vv); err != nil { - return err - } - x.m[k] = &vv - // This parent iterates, so it has the key node and needs no reflection. - setOriginKey(reflect.ValueOf(&vv), node.Content[i], nativeOriginFile) - } - *responses = x - return nil -} - -func mappingValue(node *yaml.Node, key string) *yaml.Node { - if node.Kind != yaml.MappingNode { - return nil - } - for i := 0; i+1 < len(node.Content); i += 2 { - if node.Content[i].Value == key { - return node.Content[i+1] - } - } - return nil -} From d090e36b2f1c42c898ba2a687a8f6e25f5ca727f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Insaurralde?= Date: Mon, 3 Aug 2026 07:27:15 -0300 Subject: [PATCH 04/31] Merge commit from fork MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The deepObject branch of urlValuesDecoder.DecodeObject compiled the parameter-name matcher `^\[` inside the `for key := range params` loop, recompiling it once per query key. The pattern depends only on the spec-defined parameter name (constant for the loop), not on the loop variable, so it can be compiled once and reused. Because the query-key count is attacker-controlled and unbounded, the per-key recompilation turned a single request into N regexp.MustCompile calls per deepObject parameter, consuming CPU (and allocations) during request validation before any handler runs — an uncontrolled-resource -consumption DoS (CWE-400). Compile the matcher once per DecodeObject call and reuse the *regexp.Regexp for every key, mirroring the package-level deepObjectBracketRE. Matching semantics are unchanged: the pattern still derives from the parameter name via regexp.QuoteMeta (panic-safe for any name), and *regexp.Regexp is safe for reuse. Benchmarked on the deepObject decode path (Go 1.25, darwin/arm64, M4 Pro), the hoist also makes the path markedly faster across 1k–100k junk query keys: ~13–19x less CPU, ~18–26x fewer bytes, and ~44–48x fewer allocations per request. At 100k keys a single request drops from ~147 ms / ~375 MB to ~10 ms / ~14 MB. Signed-off-by: Matías Insaurralde --- openapi3filter/req_resp_decoder.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openapi3filter/req_resp_decoder.go b/openapi3filter/req_resp_decoder.go index 702adbc84..fc233dc95 100644 --- a/openapi3filter/req_resp_decoder.go +++ b/openapi3filter/req_resp_decoder.go @@ -684,10 +684,15 @@ func (d *urlValuesDecoder) DecodeObject(param string, sm *openapi3.Serialization return propsFromString(values[0], ",", ",") } case "deepObject": + // Compile the parameter-name prefix matcher once: it depends only on + // param (constant for the whole loop), not on the loop variable. Doing + // this inside the loop recompiles it once per query key, turning an + // attacker-controlled key count into proportional CPU. + paramPrefixRE := regexp.MustCompile(fmt.Sprintf(`^%s\[`, regexp.QuoteMeta(param))) propsFn = func(params url.Values) (map[string]string, error) { props := make(map[string]string) for key, values := range params { - if !regexp.MustCompile(fmt.Sprintf(`^%s\[`, regexp.QuoteMeta(param))).MatchString(key) { + if !paramPrefixRE.MatchString(key) { continue } matches := deepObjectBracketRE.FindAllStringSubmatch(key, -1) From f5441d67f855ed34d975b3b85665764644ab1459 Mon Sep 17 00:00:00 2001 From: Pierre Fenoll Date: Mon, 3 Aug 2026 12:58:07 +0200 Subject: [PATCH 05/31] Merge commit from fork Signed-off-by: Pierre Fenoll --- openapi3filter/ghsa_74vm_87hj_r66f_test.go | 73 ++++++++++++++++++++++ openapi3filter/req_resp_decoder.go | 4 ++ 2 files changed, 77 insertions(+) create mode 100644 openapi3filter/ghsa_74vm_87hj_r66f_test.go diff --git a/openapi3filter/ghsa_74vm_87hj_r66f_test.go b/openapi3filter/ghsa_74vm_87hj_r66f_test.go new file mode 100644 index 000000000..d47f1caba --- /dev/null +++ b/openapi3filter/ghsa_74vm_87hj_r66f_test.go @@ -0,0 +1,73 @@ +package openapi3filter_test + +import ( + "io" + "net/http" + "net/http/httptest" + "strings" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/getkin/kin-openapi/openapi3" + "github.com/getkin/kin-openapi/openapi3filter" + "github.com/getkin/kin-openapi/routers" +) + +const specBody = ` +openapi: 3.0.3 +info: {title: poc, version: "1.0.0"} +paths: + /x: + get: + responses: + "200": + description: ok + content: + application/json: {} +` + +const specHeader = ` +openapi: 3.0.3 +info: {title: poc, version: "1.0.0"} +paths: + /x: + get: + responses: + "200": + description: ok + headers: + X-Thing: + content: + application/json: {} +` + +func validatedInput(t *testing.T, spec string, hdr http.Header) *openapi3filter.ResponseValidationInput { + t.Helper() + doc, err := openapi3.NewLoader().LoadFromData([]byte(spec)) + require.NoError(t, err) + err = doc.Validate(t.Context()) + require.NoError(t, err) + op := doc.Paths.Find("/x").Get + return &openapi3filter.ResponseValidationInput{ + RequestValidationInput: &openapi3filter.RequestValidationInput{ + Request: httptest.NewRequest(http.MethodGet, "/x", nil), + Route: &routers.Route{Spec: doc, Operation: op, Method: http.MethodGet, Path: "/x"}, + }, + Status: 200, + Header: hdr, + Body: io.NopCloser(strings.NewReader(`{}`)), + } +} + +func TestControl_ResponseBodyNilSchema(t *testing.T) { + in := validatedInput(t, specBody, http.Header{"Content-Type": {"application/json"}}) + err := openapi3filter.ValidateResponse(t.Context(), in) + require.NoError(t, err) +} + +func TestResponseHeaderNilSchema(t *testing.T) { + in := validatedInput(t, specHeader, http.Header{"Content-Type": {"application/json"}}) + err := openapi3filter.ValidateResponse(t.Context(), in) + require.NoError(t, err) +} diff --git a/openapi3filter/req_resp_decoder.go b/openapi3filter/req_resp_decoder.go index fc233dc95..508023899 100644 --- a/openapi3filter/req_resp_decoder.go +++ b/openapi3filter/req_resp_decoder.go @@ -270,6 +270,10 @@ func decodeStyledParameter(param *openapi3.Parameter, input *RequestValidationIn func decodeValue(dec valueDecoder, param string, sm *openapi3.SerializationMethod, schema *openapi3.SchemaRef, required bool) (any, bool, error) { var found bool + if schema == nil { + return nil, false, nil + } + if len(schema.Value.AllOf) > 0 { var value any var err error From 335f4e6abe8ecb82856651f30ed955834d90e15c Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 14:01:42 +0300 Subject: [PATCH 06/31] openapi3: store field locations in a slice, not a map (#1235) Co-authored-by: Claude Opus 5 (1M context) --- .github/docs/openapi3.txt | 47 +++++++++++++- openapi3/origin.go | 97 ++++++++++++++++++++++++---- openapi3/origin_external_ref_test.go | 6 +- openapi3/origin_test.go | 57 +++++++++------- openapi3/validation_error.go | 2 +- openapi3/validation_error_test.go | 4 +- 6 files changed, 167 insertions(+), 46 deletions(-) diff --git a/.github/docs/openapi3.txt b/.github/docs/openapi3.txt index f710e8524..81be295f4 100644 --- a/.github/docs/openapi3.txt +++ b/.github/docs/openapi3.txt @@ -991,6 +991,38 @@ func (e *ExtraSiblingFieldsError) Code() string func (e *ExtraSiblingFieldsError) Error() string +type FieldLocations []Location + FieldLocations holds the locations of a collection's scalar fields, in the + order they appear in the document. + + It is a slice rather than a map[string]Location because a collection carries + only a handful of fields, while a Go map allocates a whole bucket per + collection whatever it holds. On a large document that overhead dominated + the retained size of a parsed spec. Each Location already carries its Name, + so the lookup key costs nothing extra here. + +func (f FieldLocations) Get(name string) Location + Get returns the location of the named field, or the zero Location when the + field has none. Use Lookup to tell an absent field from a zero location. + +func (f FieldLocations) Lookup(name string) (Location, bool) + Lookup returns the location of the named field and whether it was found. + The scan is linear: collections have few fields, and a linear scan over a + contiguous slice beats a map lookup at these sizes. + + Deliberately a hand-written loop rather than slices.IndexFunc: the closure + does not inline, so IndexFunc pays a call per element. Measured on 3/6/12 + fields it is 5-100% slower on a hit and 2-3x slower on a miss, and misses + are the common case here (most fields carry no recorded location). + +func (f FieldLocations) MarshalJSON() ([]byte, error) + MarshalJSON keeps the serialized shape a name-keyed object, as it was when + this was a map, so the change is invisible to anything reading the output. + +func (f *FieldLocations) UnmarshalJSON(data []byte) error + UnmarshalJSON reads the name-keyed object written by MarshalJSON. Entries + are sorted by name, since a JSON object carries no order to restore. + type FieldVersionMismatchError struct { // Field is the field name flagged (e.g. "summary", "identifier", // "$defs", "prefixItems", "contains", ...). @@ -1872,14 +1904,23 @@ func (e *OperationValidationError) Unwrap() error type Origin struct { Key *Location `json:"key,omitempty" yaml:"key,omitempty"` - Fields map[string]Location `json:"fields,omitempty" yaml:"fields,omitempty"` + Fields FieldLocations `json:"fields,omitempty" yaml:"fields,omitempty"` Sequences map[string][]Location `json:"sequences,omitempty" yaml:"sequences,omitempty"` } - Origin contains the origin of a collection. Key is the location of the - collection itself. Fields is a map of the location of each scalar field + Origin contains the origin of a collection. Key is the location of + the collection itself. Fields holds the location of each scalar field in the collection. Sequences is a map of the location of each item in sequence-valued fields. + Sequences stays a map although Fields is a slice, which is deliberate. + FieldLocations drops the map because Location.Name already carries the key, + so the map was storing information the value repeated. Here Location.Name + holds the *item's* value (an enum member, a required property) while the key + is the *field's* name ("enum", "required", "tags"), so a slice would need a + wrapper type invented to hold it. The memory argument is also much weaker: + only a collection with a sequence-valued field allocates one at all, + which measured at 5% of collections on a large spec, and a nil map is free. + type Parameter struct { Extensions map[string]any `json:"-" yaml:"-"` Origin *Origin `json:"-" yaml:"-"` diff --git a/openapi3/origin.go b/openapi3/origin.go index b571cb3d2..1379a7c76 100644 --- a/openapi3/origin.go +++ b/openapi3/origin.go @@ -1,8 +1,9 @@ package openapi3 import ( + "encoding/json" "reflect" - "sort" + "slices" "strings" "github.com/oasdiff/yaml" @@ -12,14 +13,86 @@ var originPtrType = reflect.TypeFor[*Origin]() // Origin contains the origin of a collection. // Key is the location of the collection itself. -// Fields is a map of the location of each scalar field in the collection. +// Fields holds the location of each scalar field in the collection. // Sequences is a map of the location of each item in sequence-valued fields. +// +// Sequences stays a map although Fields is a slice, which is deliberate. +// FieldLocations drops the map because Location.Name already carries the key, +// so the map was storing information the value repeated. Here Location.Name +// holds the *item's* value (an enum member, a required property) while the key +// is the *field's* name ("enum", "required", "tags"), so a slice would need a +// wrapper type invented to hold it. The memory argument is also much weaker: +// only a collection with a sequence-valued field allocates one at all, which +// measured at 5% of collections on a large spec, and a nil map is free. type Origin struct { Key *Location `json:"key,omitempty" yaml:"key,omitempty"` - Fields map[string]Location `json:"fields,omitempty" yaml:"fields,omitempty"` + Fields FieldLocations `json:"fields,omitempty" yaml:"fields,omitempty"` Sequences map[string][]Location `json:"sequences,omitempty" yaml:"sequences,omitempty"` } +// FieldLocations holds the locations of a collection's scalar fields, in the +// order they appear in the document. +// +// It is a slice rather than a map[string]Location because a collection carries +// only a handful of fields, while a Go map allocates a whole bucket per +// collection whatever it holds. On a large document that overhead dominated +// the retained size of a parsed spec. Each Location already carries its Name, +// so the lookup key costs nothing extra here. +type FieldLocations []Location + +// Get returns the location of the named field, or the zero Location when the +// field has none. Use Lookup to tell an absent field from a zero location. +func (f FieldLocations) Get(name string) Location { + loc, _ := f.Lookup(name) + return loc +} + +// Lookup returns the location of the named field and whether it was found. +// The scan is linear: collections have few fields, and a linear scan over a +// contiguous slice beats a map lookup at these sizes. +// +// Deliberately a hand-written loop rather than slices.IndexFunc: the closure +// does not inline, so IndexFunc pays a call per element. Measured on 3/6/12 +// fields it is 5-100% slower on a hit and 2-3x slower on a miss, and misses +// are the common case here (most fields carry no recorded location). +func (f FieldLocations) Lookup(name string) (Location, bool) { + for i := range f { + if f[i].Name == name { + return f[i], true + } + } + return Location{}, false +} + +// MarshalJSON keeps the serialized shape a name-keyed object, as it was when +// this was a map, so the change is invisible to anything reading the output. +func (f FieldLocations) MarshalJSON() ([]byte, error) { + m := make(map[string]Location, len(f)) + for _, loc := range f { + m[loc.Name] = loc + } + return json.Marshal(m) +} + +// UnmarshalJSON reads the name-keyed object written by MarshalJSON. Entries are +// sorted by name, since a JSON object carries no order to restore. +func (f *FieldLocations) UnmarshalJSON(data []byte) error { + var m map[string]Location + if err := json.Unmarshal(data, &m); err != nil { + return err + } + out := make(FieldLocations, 0, len(m)) + for name, loc := range m { + if loc.Name == "" { + loc.Name = name + } + out = append(out, loc) + } + slices.SortFunc(out, func(a, b Location) int { return strings.Compare(a.Name, b.Name) }) + *f = out + return nil +} + // Location is a struct that contains the location of a field. type Location struct { File string `json:"file,omitempty" yaml:"file,omitempty"` @@ -61,17 +134,17 @@ func originFromSeq(s []any) *Origin { nf := toInt(s[idx]) idx++ if nf > 0 && idx+nf*3 <= len(s) { - o.Fields = make(map[string]Location, nf) + o.Fields = make(FieldLocations, 0, nf) for range nf { fname, _ := s[idx].(string) delta := toInt(s[idx+1]) col := toInt(s[idx+2]) - o.Fields[fname] = Location{ + o.Fields = append(o.Fields, Location{ File: file, Line: keyLine + delta, Column: col, Name: fname, - } + }) idx += 3 } } @@ -148,10 +221,13 @@ func isScalarValuedMapField(v reflect.Value) bool { return false } -// recordMapKeyLocations copies the map-key locations from a scalar-valued map's +// recordMapKeyLocations moves the map-key locations from a scalar-valued map's // own subtree onto parentOrigin.Sequences[field], so each key is addressable by // name (the same shape used for sequence items). It is a no-op when the child // carries no origin data. Keys are sorted for deterministic output. +// +// childOrigin is discarded here, and nothing else holds its Fields, so the +// slice is sorted and handed over in place rather than copied. func recordMapKeyLocations(parentOrigin *Origin, field string, childTree *yaml.OriginTree) { s, ok := childTree.Origin.([]any) if !ok { @@ -161,11 +237,8 @@ func recordMapKeyLocations(parentOrigin *Origin, field string, childTree *yaml.O if childOrigin == nil || len(childOrigin.Fields) == 0 { return } - locs := make([]Location, 0, len(childOrigin.Fields)) - for _, loc := range childOrigin.Fields { - locs = append(locs, loc) - } - sort.Slice(locs, func(i, j int) bool { return locs[i].Name < locs[j].Name }) + locs := childOrigin.Fields + slices.SortFunc(locs, func(a, b Location) int { return strings.Compare(a.Name, b.Name) }) if parentOrigin.Sequences == nil { parentOrigin.Sequences = make(map[string][]Location) } diff --git a/openapi3/origin_external_ref_test.go b/openapi3/origin_external_ref_test.go index 83f7ea019..40a562706 100644 --- a/openapi3/origin_external_ref_test.go +++ b/openapi3/origin_external_ref_test.go @@ -35,14 +35,14 @@ func TestOrigin_ExternalRefToArbitraryTopLevelKey(t *testing.T) { Name: "User", EndLine: 7, EndColumn: 19, }, *user.Origin.Key, "the key origin spans the whole User block in arbitrary_key_schemas.yaml") - require.Equal(t, 2, user.Origin.Fields["type"].Line, "field origins are attached too") + require.Equal(t, 2, user.Origin.Fields.Get("type").Line, "field origins are attached too") // the subtree gets origins as well, with the same file id := user.Properties["id"].Value require.NotNil(t, id.Origin) require.Equal(t, user.Origin.Key.File, id.Origin.Key.File) require.Equal(t, 4, id.Origin.Key.Line, "the id property's own line") - require.Equal(t, 5, id.Origin.Fields["type"].Line) + require.Equal(t, 5, id.Origin.Fields.Get("type").Line) } // Re-attaching origins reuses the origin tree retained at load time: resolving @@ -101,6 +101,6 @@ User: require.Equal(t, "User", user.Origin.Key.Name) require.Equal(t, 14, user.Origin.Key.Line, "the User: line in the document above") require.Equal(t, 17, user.Origin.Key.EndLine, "the block's last line") - require.Equal(t, 15, user.Origin.Fields["type"].Line) + require.Equal(t, 15, user.Origin.Fields.Get("type").Line) require.Empty(t, user.Origin.Key.File, "a document loaded from data has no file") } diff --git a/openapi3/origin_test.go b/openapi3/origin_test.go index 2781a655b..8db83c3f5 100644 --- a/openapi3/origin_test.go +++ b/openapi3/origin_test.go @@ -28,7 +28,7 @@ func TestOrigin_T(t *testing.T) { Column: 1, Name: "openapi", }, - doc.Origin.Fields["openapi"]) + doc.Origin.Fields.Get("openapi")) } func TestOrigin_Info(t *testing.T) { @@ -59,7 +59,7 @@ func TestOrigin_Info(t *testing.T) { Column: 3, Name: "title", }, - doc.Info.Origin.Fields["title"]) + doc.Info.Origin.Fields.Get("title")) require.Equal(t, openapi3.Location{ @@ -68,7 +68,7 @@ func TestOrigin_Info(t *testing.T) { Column: 3, Name: "version", }, - doc.Info.Origin.Fields["version"]) + doc.Info.Origin.Fields.Get("version")) } func TestOrigin_Paths(t *testing.T) { @@ -211,7 +211,7 @@ func TestOrigin_Responses(t *testing.T) { Column: 11, Name: "description", }, - base.Value("200").Value.Origin.Fields["description"]) + base.Value("200").Value.Origin.Fields.Get("description")) } func TestOrigin_Parameters(t *testing.T) { @@ -243,7 +243,7 @@ func TestOrigin_Parameters(t *testing.T) { Column: 11, Name: "in", }, - base.Origin.Fields["in"]) + base.Origin.Fields.Get("in")) require.Equal(t, openapi3.Location{ @@ -252,7 +252,7 @@ func TestOrigin_Parameters(t *testing.T) { Column: 11, Name: "name", }, - base.Origin.Fields["name"]) + base.Origin.Fields.Get("name")) } func TestOrigin_SchemaInAdditionalProperties(t *testing.T) { @@ -286,7 +286,7 @@ func TestOrigin_SchemaInAdditionalProperties(t *testing.T) { Column: 19, Name: "type", }, - base.Schema.Value.Origin.Fields["type"]) + base.Schema.Value.Origin.Fields.Get("type")) } func TestOrigin_ExternalDocs(t *testing.T) { @@ -319,7 +319,7 @@ func TestOrigin_ExternalDocs(t *testing.T) { Column: 3, Name: "description", }, - base.Origin.Fields["description"]) + base.Origin.Fields.Get("description")) require.Equal(t, openapi3.Location{ @@ -328,7 +328,7 @@ func TestOrigin_ExternalDocs(t *testing.T) { Column: 3, Name: "url", }, - base.Origin.Fields["url"]) + base.Origin.Fields.Get("url")) } func TestOrigin_Security(t *testing.T) { @@ -361,7 +361,7 @@ func TestOrigin_Security(t *testing.T) { Column: 7, Name: "type", }, - base.Origin.Fields["type"]) + base.Origin.Fields.Get("type")) require.Equal(t, &openapi3.Location{ @@ -392,7 +392,7 @@ func TestOrigin_Security(t *testing.T) { Column: 11, Name: "authorizationUrl", }, - base.Flows.Implicit.Origin.Fields["authorizationUrl"]) + base.Flows.Implicit.Origin.Fields.Get("authorizationUrl")) // scopes is a map[string]string, which decodes without an Origin of its own, // so its per-key locations are recorded on the flow's Origin as a named @@ -434,7 +434,7 @@ func TestOrigin_Example(t *testing.T) { Column: 17, Name: "summary", }, - base.Origin.Fields["summary"]) + base.Origin.Fields.Get("summary")) // Example.Value is an any-typed field, so __origin__ is stripped from it during unmarshaling. require.NotContains(t, @@ -471,7 +471,7 @@ func TestOrigin_XML(t *testing.T) { Column: 21, Name: "namespace", }, - base.Origin.Fields["namespace"]) + base.Origin.Fields.Get("namespace")) require.Equal(t, openapi3.Location{ @@ -480,7 +480,7 @@ func TestOrigin_XML(t *testing.T) { Column: 21, Name: "prefix", }, - base.Origin.Fields["prefix"]) + base.Origin.Fields.Get("prefix")) } // TestOrigin_AnyFieldsStripped verifies that __origin__ is absent from all @@ -672,7 +672,7 @@ func TestOrigin_WithExternalRef(t *testing.T) { Column: 3, Name: "namespace", }, - base.XML.Origin.Fields["namespace"]) + base.XML.Origin.Fields.Get("namespace")) require.Equal(t, openapi3.Location{ @@ -681,7 +681,7 @@ func TestOrigin_WithExternalRef(t *testing.T) { Column: 3, Name: "prefix", }, - base.XML.Origin.Fields["prefix"]) + base.XML.Origin.Fields.Get("prefix")) } // TestOrigin_WithExternalRefRootOrigin verifies that the root-level schema of an @@ -721,7 +721,7 @@ func TestOrigin_WithExternalRefRootOrigin(t *testing.T) { Column: 1, Name: "type", }, - base.Origin.Fields["type"]) + base.Origin.Fields.Get("type")) } // TestOrigin_MaplikeNoOriginKey verifies that __origin__ does not appear as a @@ -776,7 +776,7 @@ func TestOrigin_RequiredSequence(t *testing.T) { require.NotNil(t, schema.Origin) // "required" must appear in Fields (it's a sequence-valued field) - require.Contains(t, schema.Origin.Fields, "required") + require.True(t, mustHaveField(schema.Origin.Fields, "required")) // Sequences must record per-item locations for "required" seqLocs, ok := schema.Origin.Sequences["required"] @@ -854,7 +854,7 @@ func TestOrigin_Headers(t *testing.T) { Column: 15, Name: "description", }, - headers["X-Rate-Limit"].Value.Origin.Fields["description"]) + headers["X-Rate-Limit"].Value.Origin.Fields.Get("description")) require.Equal(t, &openapi3.Location{ @@ -941,29 +941,36 @@ func TestOrigin_MappingFields(t *testing.T) { file := "testdata/origin/mapping_fields.yaml" // dependentRequired is a map[string][]string — mapping-valued - require.Contains(t, schema.Origin.Fields, "dependentRequired") + require.True(t, mustHaveField(schema.Origin.Fields, "dependentRequired")) require.Equal(t, openapi3.Location{ File: file, Line: 18, Column: 21, Name: "dependentRequired", - }, schema.Origin.Fields["dependentRequired"]) + }, schema.Origin.Fields.Get("dependentRequired")) // dependentSchemas is a Schemas map — mapping-valued - require.Contains(t, schema.Origin.Fields, "dependentSchemas") + require.True(t, mustHaveField(schema.Origin.Fields, "dependentSchemas")) require.Equal(t, openapi3.Location{ File: file, Line: 22, Column: 21, Name: "dependentSchemas", - }, schema.Origin.Fields["dependentSchemas"]) + }, schema.Origin.Fields.Get("dependentSchemas")) // patternProperties is a Schemas map — mapping-valued - require.Contains(t, schema.Origin.Fields, "patternProperties") + require.True(t, mustHaveField(schema.Origin.Fields, "patternProperties")) require.Equal(t, openapi3.Location{ File: file, Line: 25, Column: 21, Name: "patternProperties", - }, schema.Origin.Fields["patternProperties"]) + }, schema.Origin.Fields.Get("patternProperties")) +} + +// mustHaveField reports whether the named field carries a location, the +// slice-shaped equivalent of asserting a key is present in a map. +func mustHaveField(f openapi3.FieldLocations, name string) bool { + _, ok := f.Lookup(name) + return ok } diff --git a/openapi3/validation_error.go b/openapi3/validation_error.go index f2954afb3..f5e78e2fa 100644 --- a/openapi3/validation_error.go +++ b/openapi3/validation_error.go @@ -1424,7 +1424,7 @@ func exampleValueOrigin(ex *Example, fallback *Origin) *Origin { if ex == nil || ex.Origin == nil { return fallback } - if loc, ok := ex.Origin.Fields["value"]; ok { + if loc, ok := ex.Origin.Fields.Lookup("value"); ok { return &Origin{Key: &loc} } return ex.Origin diff --git a/openapi3/validation_error_test.go b/openapi3/validation_error_test.go index ebae2a290..21bfbfa18 100644 --- a/openapi3/validation_error_test.go +++ b/openapi3/validation_error_test.go @@ -382,8 +382,8 @@ paths: {} require.Equal(t, "openapi", rfe.Field) require.NotNil(t, rfe.Origin, "doc-root fields now carry the document's Origin") require.Same(t, doc.Origin, rfe.Origin, "the error carries T.Origin") - require.Greater(t, rfe.Origin.Fields["openapi"].Line, 0, - `Origin.Fields["openapi"] locates the openapi: line`) + require.Greater(t, rfe.Origin.Fields.Get("openapi").Line, 0, + `Origin.Fields.Get("openapi") locates the openapi: line`) } // SchemaValueError clusters "'s example/default value From 2b2a07f872d6e4efdea433eca005818582aa464f Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 14:18:52 +0300 Subject: [PATCH 07/31] Wire the loader to the native path unmarshal now decodes through UnmarshalYAML on the stock parser, falling back to the json path for what yaml will not accept -- most importantly duplicate keys, which json resolves last-one-wins and yaml rejects. Status: 24 failures in openapi3, of which 13 are the deliberate consequence of the design (tests asserting EndLine/EndColumn, which the stock parser does not record and which the consumer now derives). The remaining 11 are real work, in four groups: 3 the arbitrary-top-level-key $ref path, which attachOriginToResolved handles today and the node path does not reach yet 2 nil-versus-empty on maplike collections: the helper always allocates, so an absent responses no longer fails validation 1 TestUnmarshalError expects the field-level message the yaml wrapper's internal json step produced; a native decode reports a yaml-level error instead, which is more accurate for a yaml document but is a changed contract 5 origin coverage gaps: T, schema-in-additionalProperties, origin in properties, external-ref root Two bugs found and fixed on the way, both of which would have been invisible without the suite. Origins were produced even when the caller had not asked for them, because the gate read the package-level IncludeOrigin rather than the flag the Loader passes in -- and the package global is seeded into NewLoader, so test pollution was making that look correct. And a parameter inside a sequence had no Key, because the stamping walked mappings only; a sequence item takes its own first key, which is the choice the existing origin code makes. --- openapi3/marsh.go | 29 +- openapi3/native_e2e_test.go | 3 + openapi3/native_yaml.go | 55 +- openapi3/native_yaml_refs.go | 18 +- openapi3/native_yaml_shadow.go | 96 +- openapi3/native_yaml_special.go | 2 +- openapi3/native_yaml_test.go | 6 + ...rd_com_events_1_2_0_openapi_yaml__validate | 11 +- ...nceControlService_1_openapi_yaml__validate | 10 + ...ntNotification_v1_1_openapi_yaml__validate | 10 + ...rtNotification_v1_1_openapi_yaml__validate | 10 + ..._com_CheckoutService_37_openapi_yaml__load | 2 +- ..._com_CheckoutService_40_openapi_yaml__load | 2 +- ..._com_CheckoutService_41_openapi_yaml__load | 2 +- ..._com_CheckoutService_46_openapi_yaml__load | 2 +- ..._com_CheckoutService_49_openapi_yaml__load | 2 +- ..._com_CheckoutService_50_openapi_yaml__load | 2 +- ..._com_CheckoutService_51_openapi_yaml__load | 2 +- ..._com_CheckoutService_52_openapi_yaml__load | 2 +- ..._com_CheckoutService_53_openapi_yaml__load | 2 +- ..._com_CheckoutService_64_openapi_yaml__load | 2 +- ..._com_CheckoutService_65_openapi_yaml__load | 2 +- ..._com_CheckoutService_66_openapi_yaml__load | 2 +- ..._com_CheckoutService_67_openapi_yaml__load | 2 +- ..._com_CheckoutService_68_openapi_yaml__load | 2 +- ..._com_CheckoutService_69_openapi_yaml__load | 2 +- ..._com_CheckoutService_70_openapi_yaml__load | 2 +- ..._CheckoutService_v71_71_openapi_yaml__load | 2 +- ...icationService_v1_1_openapi_yaml__validate | 61 +- ...ManagementService_1_openapi_yaml__validate | 37 +- ...agementService_v3_3_openapi_yaml__validate | 37 +- ...tificationService_4_openapi_yaml__validate | 11 +- ...tificationService_5_openapi_yaml__validate | 11 +- ...tificationService_6_openapi_yaml__validate | 11 +- ...n_com_PaymentService_25_openapi_yaml__load | 2 +- ...n_com_PaymentService_30_openapi_yaml__load | 2 +- ...n_com_PaymentService_40_openapi_yaml__load | 2 +- ...n_com_PaymentService_46_openapi_yaml__load | 2 +- ...n_com_PaymentService_49_openapi_yaml__load | 2 +- ...n_com_PaymentService_50_openapi_yaml__load | 2 +- ...n_com_PaymentService_51_openapi_yaml__load | 2 +- ...n_com_PaymentService_52_openapi_yaml__load | 2 +- ...n_com_PaymentService_64_openapi_yaml__load | 2 +- ...n_com_PaymentService_67_openapi_yaml__load | 2 +- ...n_com_PaymentService_68_openapi_yaml__load | 2 +- ...om_PayoutService_30_openapi_yaml__validate | 11 + ...om_PayoutService_40_openapi_yaml__validate | 11 + ...en_com_PayoutService_46_openapi_yaml__load | 2 +- ...en_com_PayoutService_49_openapi_yaml__load | 2 +- ...om_PayoutService_50_openapi_yaml__validate | 11 + ...om_PayoutService_51_openapi_yaml__validate | 11 + ...om_PayoutService_52_openapi_yaml__validate | 11 + ...om_PayoutService_64_openapi_yaml__validate | 11 + ...om_PayoutService_67_openapi_yaml__validate | 11 + ...om_PayoutService_68_openapi_yaml__validate | 11 + ...RecurringService_25_openapi_yaml__validate | 9 + ...RecurringService_30_openapi_yaml__validate | 9 + ...RecurringService_40_openapi_yaml__validate | 9 + ...RecurringService_49_openapi_yaml__validate | 9 + ...RecurringService_67_openapi_yaml__validate | 9 + ...RecurringService_68_openapi_yaml__validate | 9 + ...m_TransferService_2_openapi_yaml__validate | 99 + ...m_TransferService_3_openapi_yaml__validate | 99 + ...ransferService_v4_4_openapi_yaml__validate | 128 + .../amadeus_com_2_2_0_openapi_yaml__validate | 29 +- ...rice_analysis_1_0_1_openapi_yaml__validate | 7 +- ...adeus_trip_parser_3_0_1_openapi_yaml__load | 2 +- ...hicle_enquiry_1_1_0_openapi_yaml__validate | 12 +- ...m_accounting_10_0_0_openapi_yaml__validate | 52 +- ...deck_com_ats_10_0_0_openapi_yaml__validate | 13 + ...deck_com_crm_10_0_0_openapi_yaml__validate | 11 + ...tomer_support_9_5_0_openapi_yaml__validate | 13 + ...om_ecommerce_10_0_0_openapi_yaml__validate | 14 + ...file_storage_10_0_0_openapi_yaml__validate | 14 + ...eck_com_hris_10_0_0_openapi_yaml__validate | 21 +- ...sue_tracking_10_0_0_openapi_yaml__validate | 14 + ...eck_com_lead_10_0_0_openapi_yaml__validate | 13 + ...deck_com_pos_10_0_0_openapi_yaml__validate | 13 +- ...deck_com_sms_10_0_0_openapi_yaml__validate | 14 + ...ck_com_vault_10_0_0_openapi_yaml__validate | 10 + ..._com_webhook_10_0_0_openapi_yaml__validate | 14 + .../apis_guru_2_2_0_openapi_yaml__validate | 60 +- ...e_org_wayback_1_0_0_openapi_yaml__validate | 18 + .../asana_com_1_0_openapi_yaml__validate | 12 +- .../ato_gov_au_0_0_6_openapi_yaml__validate | 13 +- .../box_com_2_0_0_openapi_yaml__validate | 301 +- .../braze_com_1_0_0_openapi_yaml__validate | 9 + .../bunq_com_1_0_openapi_yaml__load | 2 +- ...a_holidays_ca_1_8_0_openapi_yaml__validate | 11 + .../chain49_com_2_0_openapi_yaml__validate | 40 + ...aingateway_io_1_0_0_openapi_yaml__validate | 9 + ...chaingateway_io_1_0_openapi_yaml__validate | 8 + ...dat_io_accounting_2_1_0_openapi_yaml__load | 2 +- .../codat_io_assess_1_0_openapi_yaml__load | 3 +- ...io_bank_feeds_2_1_0_openapi_yaml__validate | 13 +- ...at_io_banking_2_1_0_openapi_yaml__validate | 7 +- ...o_sync_for_commerce_1_1_openapi_yaml__load | 3 +- ...c_for_expenses_prealpha_openapi_yaml__load | 3 +- ...rencytick_com_1_0_0_openapi_yaml__validate | 10 + .../dev_to_1_0_0_openapi_yaml__validate | 35 +- .../digitalnz_org_3_openapi_yaml__validate | 17 +- ...ker_com_engine_1_33_openapi_yaml__validate | 18 +- ...docker_com_hub_beta_openapi_yaml__validate | 9 +- .../docusign_net_v2_1_openapi_yaml__load | 2 +- .../dodo_ac_1_6_0_openapi_yaml__validate | 30 +- .../exavault_com_2_0_openapi_yaml__validate | 11 +- .../fec_gov_1_0_openapi_yaml__validate | 20 +- .../figshare_com_2_0_0_openapi_yaml__validate | 10 +- .../files_com_0_0_1_openapi_yaml__validate | 75 +- .../fire_com_1_0_openapi_yaml__validate | 8 +- .../flat_io_2_13_0_openapi_yaml__validate | 28 +- .../formapi_io_v1_openapi_yaml__validate | 9 + ...tpostman_com_1_20_0_openapi_yaml__validate | 9 + .../giphy_com_1_0_openapi_yaml__validate | 12 +- ...pi_github_com_1_1_4_openapi_yaml__validate | 8 +- ...om_2022_11_28_1_1_4_openapi_yaml__validate | 8 +- ...thub_com_ghec_1_1_4_openapi_yaml__validate | 11 +- ...ec_2022_11_28_1_1_4_openapi_yaml__validate | 11 +- ...com_ghes_2_18_1_1_4_openapi_yaml__validate | 8 +- ...com_ghes_2_19_1_1_4_openapi_yaml__validate | 8 +- ...com_ghes_2_20_1_1_4_openapi_yaml__validate | 8 +- ...com_ghes_2_21_1_1_4_openapi_yaml__validate | 8 +- ...com_ghes_2_22_1_1_4_openapi_yaml__validate | 7 +- ..._com_ghes_3_0_1_1_4_openapi_yaml__validate | 10 +- ..._com_ghes_3_1_1_1_4_openapi_yaml__validate | 10 +- ..._com_ghes_3_2_1_1_4_openapi_yaml__validate | 10 +- ..._com_ghes_3_3_1_1_4_openapi_yaml__validate | 10 +- ..._com_ghes_3_4_1_1_4_openapi_yaml__validate | 10 +- ..._com_ghes_3_5_1_1_4_openapi_yaml__validate | 10 +- ..._com_ghes_3_6_1_1_4_openapi_yaml__validate | 10 +- ..._com_ghes_3_7_1_1_4_openapi_yaml__validate | 11 +- ..._com_ghes_3_8_1_1_4_openapi_yaml__validate | 11 +- ...com_github_ae_1_1_4_openapi_yaml__validate | 10 +- ..._bc_ca_bcgnws_3_x_x_openapi_yaml__validate | 4 +- ...ndhog_day_com_1_2_1_openapi_yaml__validate | 8 + ...hetzner_cloud_1_0_0_openapi_yaml__validate | 14 +- ...tion_preferences_v3_openapi_yaml__validate | 60 + ...api_com_webhooks_v3_openapi_yaml__validate | 20 + .../icons8_com_1_0_0_openapi_yaml__validate | 8 + ...stcodes_co_uk_3_7_0_openapi_yaml__validate | 10 +- ...travel_hotels_1_003_openapi_yaml__validate | 9 + .../increase_com_0_0_1_openapi_yaml__validate | 4111 +---------------- ..._4+0_gb463b49_dirty_openapi_yaml__validate | 13 +- ...lityscore_com_1_0_0_openapi_yaml__validate | 9 + ..._com_payments_1_0_0_openapi_yaml__validate | 10 + .../lgtm_com_v1_0_openapi_yaml__validate | 172 +- ...ailchimp_com_3_0_55_openapi_yaml__validate | 25 +- .../medium_com_1_0_openapi_yaml__validate | 10 +- ...com_0_0_0_streaming_openapi_yaml__validate | 30 +- .../meraki_com_1_32_0_openapi_yaml__validate | 10 + ...ices_Prediction_1_1_openapi_yaml__validate | 10 + ...ices_Prediction_2_0_openapi_yaml__validate | 10 + ...ices_Prediction_3_0_openapi_yaml__validate | 12 +- ...rvices_Training_1_2_openapi_yaml__validate | 22 + ...rvices_Training_2_0_openapi_yaml__validate | 21 +- ...rvices_Training_2_1_openapi_yaml__validate | 21 +- ...rvices_Training_2_2_openapi_yaml__validate | 21 +- ...rvices_Training_3_0_openapi_yaml__validate | 23 +- ...rvices_Training_3_1_openapi_yaml__validate | 23 +- ...rvices_Training_3_2_openapi_yaml__validate | 23 +- .../mux_com_v1_openapi_yaml__validate | 9 + ...utrinoapi_net_3_6_4_openapi_yaml__validate | 10 + ..._conversation_2_0_1_openapi_yaml__validate | 10 +- ...nversation_v2_1_0_1_openapi_yaml__validate | 6 +- ...om_conversion_1_0_1_openapi_yaml__validate | 8 + ..._com_dispatch_0_3_4_openapi_yaml__validate | 15 +- ...xmo_com_media_1_0_2_openapi_yaml__validate | 10 + ...sages_olympus_1_4_0_openapi_yaml__validate | 8 +- ...o_com_reports_2_2_2_openapi_yaml__validate | 12 +- ...nexmo_com_sms_1_2_0_openapi_yaml__validate | 10 + ...m_subaccounts_1_0_8_openapi_yaml__validate | 9 +- .../notion_com_1_0_0_openapi_yaml__validate | 10 +- ...owpayments_io_1_0_0_openapi_yaml__validate | 9 + ...tropy_network_1_0_0_openapi_yaml__validate | 9 + ...com_books_api_3_0_0_openapi_yaml__validate | 24 + .../openaq_local_2_0_0_openapi_yaml__validate | 19 + ...ates_org_2021_11_12_openapi_yaml__validate | 10 + .../openuv_io_v1_openapi_yaml__validate | 12 +- ...andascore_co_2_23_1_openapi_yaml__validate | 344 +- .../pay1_de_link_v1_openapi_yaml__validate | 12 +- ...eratorapi_com_3_1_1_openapi_yaml__validate | 11 +- ...io_de_personnel_1_0_openapi_yaml__validate | 20 + ...phantauth_net_1_0_0_openapi_yaml__validate | 9 + ..._2020_09_14_1_345_1_openapi_yaml__validate | 315 +- ...pocketsmith_com_2_0_openapi_yaml__validate | 8 +- ...sassociation_io_2_0_openapi_yaml__validate | 6 +- .../probely_com_1_2_0_openapi_yaml__validate | 13 +- ...proxykingdom_com_v1_openapi_yaml__validate | 10 + .../prss_org_2_0_0_openapi_yaml__validate | 11 + .../qualtrics_com_0_2_openapi_yaml__validate | 9 + ...com_ecowetter_1_0_0_openapi_yaml__validate | 8 + .../rebilly_com_2_1_openapi_yaml__validate | 13 +- .../rentcast_io_1_0_openapi_yaml__validate | 2 +- .../salesloft_com_v2_openapi_yaml__validate | 15 +- .../sendgrid_com_1_0_0_openapi_yaml__load | 2 +- ...om_1_1_202304191404_openapi_yaml__validate | 12 +- .../shorten_rest_1_0_0_openapi_yaml__validate | 10 + ...terstock_com_1_1_32_openapi_yaml__validate | 33 +- .../snyk_io_1_0_0_openapi_yaml__validate | 6 +- ..._sonallux_2023_2_27_openapi_yaml__validate | 10 + .../squareup_com_2_0_openapi_yaml__validate | 152 +- .../statsocial_com_1_0_0_openapi_yaml__load | 1 - .../taxrates_io_1_0_0_openapi_yaml__validate | 9 + ...maticssdk_com_1_0_0_openapi_yaml__validate | 9 + .../telnyx_com_2_0_0_openapi_yaml__validate | 8 +- ...racingapi_com_1_0_0_openapi_yaml__validate | 11 + ...enmetrics_com_1_0_0_openapi_yaml__validate | 9 + ...ehealth_com_v7_78_1_openapi_yaml__validate | 9 +- ...er_com_current_2_62_openapi_yaml__validate | 268 +- .../unicourt_com_1_0_0_openapi_yaml__validate | 14 +- .../up_com_au_v1_openapi_yaml__validate | 9 + ..._gov_benefits_1_0_0_openapi_yaml__validate | 11 +- ..._confirmation_0_0_1_openapi_yaml__validate | 11 + .../va_gov_forms_0_0_0_openapi_yaml__validate | 12 +- .../vercel_com_0_0_1_openapi_yaml__load | 3 +- .../viator_com_1_0_0_openapi_yaml__validate | 219 +- ...ing_com_weather_4_6_openapi_yaml__validate | 6 +- ...e_com_reports_1_0_1_openapi_yaml__validate | 8 +- ...cal_Catalog_API_1_0_openapi_yaml__validate | 11 +- ...Seller_Portal_1_0_0_openapi_yaml__validate | 12 +- ...al_Checkout_API_1_0_openapi_yaml__validate | 11 +- ...omer_Credit_API_1_0_openapi_yaml__validate | 8 +- ...al_Giftcard_API_1_0_openapi_yaml__validate | 10 + ...tplace_Protocol_1_0_openapi_yaml__validate | 7 +- ...MasterData_API__1_0_openapi_yaml__validate | 16 + ...aster_Data_API__1_0_openapi_yaml__validate | 16 + ...ocal_Orders_API_1_0_openapi_yaml__validate | 6 +- ...I__PII_version__1_0_openapi_yaml__validate | 6 +- ...nts_Gateway_API_1_0_openapi_yaml__validate | 8 + ...cal_Pricing_API_1_0_openapi_yaml__validate | 18 + ...cal_Pricing_Hub_1_0_openapi_yaml__validate | 18 + ..._Profile_System_1_0_openapi_yaml__validate | 10 + ...cal_Promotions__1_0_openapi_yaml__validate | 16 + ...and_Ratings_API_1_0_openapi_yaml__validate | 9 + ...ocal_Search_API_1_0_openapi_yaml__validate | 11 + ...ptions_API__v2__1_0_openapi_yaml__validate | 24 +- ...cal_VTEX_Do_API_1_0_openapi_yaml__validate | 8 + ...lthreader_com_1_0_0_openapi_yaml__validate | 10 +- ...uora_com_2021_08_20_openapi_yaml__validate | 197 +- 239 files changed, 2835 insertions(+), 6362 deletions(-) create mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalanceControlService_1_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalancePlatformPaymentNotification_v1_1_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalancePlatformReportNotification_v1_1_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_30_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_40_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_50_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_51_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_52_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_64_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_67_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_68_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_25_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_30_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_40_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_49_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_67_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_68_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_2_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_3_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_v4_4_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/apideck_com_ats_10_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/apideck_com_crm_10_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/apideck_com_customer_support_9_5_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/apideck_com_ecommerce_10_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/apideck_com_file_storage_10_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/apideck_com_issue_tracking_10_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/apideck_com_lead_10_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/apideck_com_sms_10_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/apideck_com_vault_10_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/apideck_com_webhook_10_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/archive_org_wayback_1_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/braze_com_1_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/canada_holidays_ca_1_8_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/chain49_com_2_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/chaingateway_io_1_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/chaingateway_io_1_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/currencytick_com_1_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/formapi_io_v1_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/getpostman_com_1_20_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/groundhog_day_com_1_2_1_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/hubapi_com_communication_preferences_v3_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/hubapi_com_webhooks_v3_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/icons8_com_1_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/impala_travel_hotels_1_003_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/ipqualityscore_com_1_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/klarna_com_payments_1_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/meraki_com_1_32_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_1_1_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_2_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_1_2_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/mux_com_v1_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/neutrinoapi_net_3_6_4_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversion_1_0_1_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/nexmo_com_media_1_0_2_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/nexmo_com_sms_1_2_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/nowpayments_io_1_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/ntropy_network_1_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/nytimes_com_books_api_3_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/openaq_local_2_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/openstates_org_2021_11_12_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/phantauth_net_1_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/proxykingdom_com_v1_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/prss_org_2_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/qualtrics_com_0_2_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/rapidapi_com_ecowetter_1_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/shorten_rest_1_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/spotify_com_sonallux_2023_2_27_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/statsocial_com_1_0_0_openapi_yaml__load create mode 100644 openapi3/testdata/apis_guru_openapi_directory/taxrates_io_1_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/telematicssdk_com_1_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/theracingapi_com_1_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/tokenmetrics_com_1_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/up_com_au_v1_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/va_gov_confirmation_0_0_1_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_Giftcard_API_1_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_MasterData_API__1_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_Master_Data_API__1_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_Payments_Gateway_API_1_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_Pricing_API_1_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_Pricing_Hub_1_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_Profile_System_1_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_Promotions__1_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_Reviews_and_Ratings_API_1_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_Search_API_1_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_VTEX_Do_API_1_0_openapi_yaml__validate diff --git a/openapi3/marsh.go b/openapi3/marsh.go index f895e6e40..b97b339ce 100644 --- a/openapi3/marsh.go +++ b/openapi3/marsh.go @@ -6,7 +6,7 @@ import ( "net/url" "strings" - "github.com/oasdiff/yaml" + goyaml "go.yaml.in/yaml/v3" ) func unmarshalError(jsonUnmarshalErr error) error { @@ -23,26 +23,29 @@ func unmarshalError(jsonUnmarshalErr error) error { func unmarshal(data []byte, v any, includeOrigin bool, location *url.URL) (*originTree, error) { var jsonErr, yamlErr error - // See https://github.com/getkin/kin-openapi/issues/680 - if jsonErr = json.Unmarshal(data, v); jsonErr == nil { - return nil, nil - } - - // UnmarshalStrict(data, v) TODO: investigate how ymlv3 handles duplicate map keys var file string if location != nil { file = location.String() } - if tree, err := yaml.Unmarshal(data, v, yaml.DecodeOpts{ - Origin: yaml.OriginOpt{Enabled: includeOrigin, File: file}, - DisableTimestamps: true, - }); err == nil { - applyOrigins(v, tree) - return tree, nil + + // Native decode: one parse, straight into the types via UnmarshalYAML, + // with origins read off the nodes. No JSON round trip, no __origin__ + // channel, and JSON documents get origins too since JSON parses as YAML. + originFileVar, originEnabledVar = file, includeOrigin + if err := goyaml.Unmarshal(data, v); err == nil { + return nil, nil } else { yamlErr = err } + // Fall back to the json path for what the yaml parser will not accept -- + // most importantly duplicate keys, which json resolves last-one-wins and + // yaml rejects. Such documents load as they always did, without origins. + // See https://github.com/getkin/kin-openapi/issues/680 + if jsonErr = json.Unmarshal(data, v); jsonErr == nil { + return nil, nil + } + // If both unmarshaling attempts fail, return a new error that includes both errors return nil, fmt.Errorf("failed to unmarshal data: json error: %v, yaml error: %v", jsonErr, yamlErr) } diff --git a/openapi3/native_e2e_test.go b/openapi3/native_e2e_test.go index 1aec2d3f4..d78e11019 100644 --- a/openapi3/native_e2e_test.go +++ b/openapi3/native_e2e_test.go @@ -52,6 +52,9 @@ func TestNativeE2E_WholeDocument(t *testing.T) { // And origins must reach the places oasdiff reads them from. func TestNativeE2E_OriginsReachOperations(t *testing.T) { + defer func(v bool) { originEnabledVar = v }(originEnabledVar) + originEnabledVar = true + data, err := os.ReadFile("testdata/callbacks.yml") require.NoError(t, err) var doc T diff --git a/openapi3/native_yaml.go b/openapi3/native_yaml.go index 67a40660d..6c695cbe3 100644 --- a/openapi3/native_yaml.go +++ b/openapi3/native_yaml.go @@ -26,9 +26,21 @@ import ( // being a trailing blank-or-comment boundary convention. That is what lets // this run on the stock parser. -// nativeOriginFile is the file stamped into origins. The loader supplies it -// per document in the wired-up version; the spike decodes one file. -const nativeOriginFile = "" +// originFileVar is the file stamped into origins for the decode in progress. +// +// UnmarshalYAML receives a node and nothing else, so the file cannot be +// threaded through the call. This follows the precedent of IncludeOrigin, +// which is already a package-level decode setting, and inherits its +// concurrency characteristics: one decode at a time per process. Making both +// per-Loader is worth doing, but is a separate change to a public API. +var originFileVar string + +// originEnabledVar mirrors the includeOrigin argument unmarshal receives, which +// comes from the Loader rather than from the package-level IncludeOrigin. +// Gating on the global would miss a caller that set it only on its Loader. +var originEnabledVar bool + +func nativeOriginFile() string { return originFileVar } // mappingValue returns the value node for key, or nil. func mappingValue(node *yaml.Node, key string) *yaml.Node { @@ -111,6 +123,11 @@ func decodeStructWithExtensions(node *yaml.Node, out any) (map[string]any, error // Origin.Key is not set here -- it is the location of the key heading this // mapping in its parent, which a node does not know. See setChildOriginKeys. func originFromNode(node *yaml.Node, file string) *Origin { + // Origins are opt-in. Without this every decode pays for them and every + // consumer sees positions it did not ask for. + if !originEnabledVar { + return nil + } if node == nil || node.Kind != yaml.MappingNode { return nil } @@ -152,6 +169,9 @@ func originFromNode(node *yaml.Node, file string) *Origin { // covered without anyone walking it -- unlike applyOrigins, which rebuilds the // whole tree in parallel with a separately-built OriginTree. func setChildOriginKeys(node *yaml.Node, container any, file string) { + if !originEnabledVar { + return + } if node == nil || node.Kind != yaml.MappingNode { return } @@ -170,11 +190,27 @@ func setChildOriginKeys(node *yaml.Node, container any, file string) { } setOriginKey(child, keyNode, file) - // A map-valued field (Content, Headers, Links) holds children of its - // own, each keyed in valNode. They are decoded by the generic map - // decoder, which has no hook to stamp them, so descend here. - if m := deref(child); m.Kind() == reflect.Map && m.CanInterface() { - setChildOriginKeys(valNode, m.Interface(), file) + switch c := deref(child); c.Kind() { + case reflect.Map: + // A map-valued field (Content, Headers, Links) holds children of + // its own, each keyed in valNode. They are decoded by the generic + // map decoder, which has no hook to stamp them, so descend here. + if c.CanInterface() { + setChildOriginKeys(valNode, c.Interface(), file) + } + case reflect.Slice: + // A sequence item has no key above it, so it takes its own first + // key as its Key -- the same choice the existing origin code makes + // ("in case of a sequence, we use the first element as the key"). + if valNode.Kind != yaml.SequenceNode { + continue + } + for j := 0; j < len(valNode.Content) && j < c.Len(); j++ { + item := valNode.Content[j] + if item.Kind == yaml.MappingNode && len(item.Content) > 0 { + setOriginKey(c.Index(j), item.Content[0], file) + } + } } } } @@ -216,6 +252,9 @@ func childByKey(v reflect.Value, key string) reflect.Value { // position: the extent of what it heads is the consumer's to derive from the // next boundary, which is what removes the need for a patched parser. func setOriginKey(child reflect.Value, keyNode *yaml.Node, file string) { + if !originEnabledVar { + return + } for child.Kind() == reflect.Pointer || child.Kind() == reflect.Interface { if child.IsNil() { return diff --git a/openapi3/native_yaml_refs.go b/openapi3/native_yaml_refs.go index 4c5c3ff8f..6b69f0abe 100644 --- a/openapi3/native_yaml_refs.go +++ b/openapi3/native_yaml_refs.go @@ -49,7 +49,7 @@ func unmarshalRefYAML(node *yaml.Node, ref *string, summary, description **strin } func (x *CallbackRef) UnmarshalYAML(node *yaml.Node) error { - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { return nil } @@ -57,7 +57,7 @@ func (x *CallbackRef) UnmarshalYAML(node *yaml.Node) error { } func (x *ExampleRef) UnmarshalYAML(node *yaml.Node) error { - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { return nil } @@ -65,7 +65,7 @@ func (x *ExampleRef) UnmarshalYAML(node *yaml.Node) error { } func (x *HeaderRef) UnmarshalYAML(node *yaml.Node) error { - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { return nil } @@ -73,7 +73,7 @@ func (x *HeaderRef) UnmarshalYAML(node *yaml.Node) error { } func (x *LinkRef) UnmarshalYAML(node *yaml.Node) error { - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { return nil } @@ -81,7 +81,7 @@ func (x *LinkRef) UnmarshalYAML(node *yaml.Node) error { } func (x *ParameterRef) UnmarshalYAML(node *yaml.Node) error { - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { return nil } @@ -89,7 +89,7 @@ func (x *ParameterRef) UnmarshalYAML(node *yaml.Node) error { } func (x *RequestBodyRef) UnmarshalYAML(node *yaml.Node) error { - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { return nil } @@ -97,7 +97,7 @@ func (x *RequestBodyRef) UnmarshalYAML(node *yaml.Node) error { } func (x *ResponseRef) UnmarshalYAML(node *yaml.Node) error { - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { return nil } @@ -105,7 +105,7 @@ func (x *ResponseRef) UnmarshalYAML(node *yaml.Node) error { } func (x *SecuritySchemeRef) UnmarshalYAML(node *yaml.Node) error { - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { return nil } @@ -115,7 +115,7 @@ func (x *SecuritySchemeRef) UnmarshalYAML(node *yaml.Node) error { // SchemaRef differs: no summary/description, and OAS 3.1 allows keyword // siblings alongside a $ref, which are held until the reference resolves. func (x *SchemaRef) UnmarshalYAML(node *yaml.Node) error { - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) if !unmarshalRefYAML(node, &x.Ref, nil, nil, &x.Extensions) { return node.Decode(&x.Value) } diff --git a/openapi3/native_yaml_shadow.go b/openapi3/native_yaml_shadow.go index ebc9b4bea..02216c0a2 100644 --- a/openapi3/native_yaml_shadow.go +++ b/openapi3/native_yaml_shadow.go @@ -22,9 +22,9 @@ func (components *Components) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *components = Components(x) - setChildOriginKeys(node, components, nativeOriginFile) + setChildOriginKeys(node, components, nativeOriginFile()) return nil } @@ -36,9 +36,9 @@ func (contact *Contact) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *contact = Contact(x) - setChildOriginKeys(node, contact, nativeOriginFile) + setChildOriginKeys(node, contact, nativeOriginFile()) return nil } @@ -50,9 +50,9 @@ func (discriminator *Discriminator) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *discriminator = Discriminator(x) - setChildOriginKeys(node, discriminator, nativeOriginFile) + setChildOriginKeys(node, discriminator, nativeOriginFile()) return nil } @@ -64,9 +64,9 @@ func (encoding *Encoding) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *encoding = Encoding(x) - setChildOriginKeys(node, encoding, nativeOriginFile) + setChildOriginKeys(node, encoding, nativeOriginFile()) return nil } @@ -78,9 +78,9 @@ func (example *Example) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *example = Example(x) - setChildOriginKeys(node, example, nativeOriginFile) + setChildOriginKeys(node, example, nativeOriginFile()) return nil } @@ -92,9 +92,9 @@ func (e *ExternalDocs) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *e = ExternalDocs(x) - setChildOriginKeys(node, e, nativeOriginFile) + setChildOriginKeys(node, e, nativeOriginFile()) return nil } @@ -106,9 +106,9 @@ func (info *Info) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *info = Info(x) - setChildOriginKeys(node, info, nativeOriginFile) + setChildOriginKeys(node, info, nativeOriginFile()) return nil } @@ -120,9 +120,9 @@ func (license *License) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *license = License(x) - setChildOriginKeys(node, license, nativeOriginFile) + setChildOriginKeys(node, license, nativeOriginFile()) return nil } @@ -134,9 +134,9 @@ func (link *Link) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *link = Link(x) - setChildOriginKeys(node, link, nativeOriginFile) + setChildOriginKeys(node, link, nativeOriginFile()) return nil } @@ -148,9 +148,9 @@ func (mediaType *MediaType) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *mediaType = MediaType(x) - setChildOriginKeys(node, mediaType, nativeOriginFile) + setChildOriginKeys(node, mediaType, nativeOriginFile()) return nil } @@ -162,9 +162,9 @@ func (doc *T) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *doc = T(x) - setChildOriginKeys(node, doc, nativeOriginFile) + setChildOriginKeys(node, doc, nativeOriginFile()) return nil } @@ -176,9 +176,9 @@ func (operation *Operation) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *operation = Operation(x) - setChildOriginKeys(node, operation, nativeOriginFile) + setChildOriginKeys(node, operation, nativeOriginFile()) return nil } @@ -190,9 +190,9 @@ func (parameter *Parameter) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *parameter = Parameter(x) - setChildOriginKeys(node, parameter, nativeOriginFile) + setChildOriginKeys(node, parameter, nativeOriginFile()) return nil } @@ -204,9 +204,9 @@ func (pathItem *PathItem) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *pathItem = PathItem(x) - setChildOriginKeys(node, pathItem, nativeOriginFile) + setChildOriginKeys(node, pathItem, nativeOriginFile()) return nil } @@ -218,9 +218,9 @@ func (requestBody *RequestBody) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *requestBody = RequestBody(x) - setChildOriginKeys(node, requestBody, nativeOriginFile) + setChildOriginKeys(node, requestBody, nativeOriginFile()) return nil } @@ -232,9 +232,9 @@ func (response *Response) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *response = Response(x) - setChildOriginKeys(node, response, nativeOriginFile) + setChildOriginKeys(node, response, nativeOriginFile()) return nil } @@ -246,9 +246,9 @@ func (schema *Schema) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *schema = Schema(x) - setChildOriginKeys(node, schema, nativeOriginFile) + setChildOriginKeys(node, schema, nativeOriginFile()) return nil } @@ -260,9 +260,9 @@ func (ss *SecurityScheme) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *ss = SecurityScheme(x) - setChildOriginKeys(node, ss, nativeOriginFile) + setChildOriginKeys(node, ss, nativeOriginFile()) return nil } @@ -274,9 +274,9 @@ func (flows *OAuthFlows) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *flows = OAuthFlows(x) - setChildOriginKeys(node, flows, nativeOriginFile) + setChildOriginKeys(node, flows, nativeOriginFile()) return nil } @@ -288,9 +288,9 @@ func (flow *OAuthFlow) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *flow = OAuthFlow(x) - setChildOriginKeys(node, flow, nativeOriginFile) + setChildOriginKeys(node, flow, nativeOriginFile()) return nil } @@ -302,9 +302,9 @@ func (server *Server) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *server = Server(x) - setChildOriginKeys(node, server, nativeOriginFile) + setChildOriginKeys(node, server, nativeOriginFile()) return nil } @@ -316,9 +316,9 @@ func (serverVariable *ServerVariable) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *serverVariable = ServerVariable(x) - setChildOriginKeys(node, serverVariable, nativeOriginFile) + setChildOriginKeys(node, serverVariable, nativeOriginFile()) return nil } @@ -330,9 +330,9 @@ func (tag *Tag) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *tag = Tag(x) - setChildOriginKeys(node, tag, nativeOriginFile) + setChildOriginKeys(node, tag, nativeOriginFile()) return nil } @@ -344,8 +344,8 @@ func (xml *XML) UnmarshalYAML(node *yaml.Node) error { return err } x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile) + x.Origin = originFromNode(node, nativeOriginFile()) *xml = XML(x) - setChildOriginKeys(node, xml, nativeOriginFile) + setChildOriginKeys(node, xml, nativeOriginFile()) return nil } diff --git a/openapi3/native_yaml_special.go b/openapi3/native_yaml_special.go index baa7a272c..4b675071f 100644 --- a/openapi3/native_yaml_special.go +++ b/openapi3/native_yaml_special.go @@ -37,7 +37,7 @@ func unmarshalMaplikeYAML[V any](node *yaml.Node, ext *map[string]any, out *map[ (*out)[k] = &vv // This parent iterates, so it holds the key node and needs no // reflection to stamp it. - setOriginKey(reflect.ValueOf(&vv), node.Content[i], nativeOriginFile) + setOriginKey(reflect.ValueOf(&vv), node.Content[i], nativeOriginFile()) } return nil } diff --git a/openapi3/native_yaml_test.go b/openapi3/native_yaml_test.go index 1af9046a8..2ab416f44 100644 --- a/openapi3/native_yaml_test.go +++ b/openapi3/native_yaml_test.go @@ -47,6 +47,9 @@ func TestNativeStock_MatchesJSONPath(t *testing.T) { // a block is derivable from the next boundary, which is what lets this run on // an unpatched parser. func TestNativeStock_OriginsMatchExceptEnds(t *testing.T) { + defer func(v bool) { originEnabledVar = v }(originEnabledVar) + originEnabledVar = true + var viaTree Responses tree, err := kinyaml.Unmarshal([]byte(nativeSrc), &viaTree, kinyaml.DecodeOpts{ Origin: kinyaml.OriginOpt{Enabled: true}, @@ -95,6 +98,9 @@ func TestNativeStock_OriginsMatchExceptEnds(t *testing.T) { // The origin has to reach the nested media type, not just the top level. func TestNativeStock_OriginsAtDepth(t *testing.T) { + defer func(v bool) { originEnabledVar = v }(originEnabledVar) + originEnabledVar = true + var r Responses require.NoError(t, goyaml.Unmarshal([]byte(nativeSrc), &r)) mt := r.Value("200").Value.Content["application/json"] diff --git a/openapi3/testdata/apis_guru_openapi_directory/1password_com_events_1_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/1password_com_events_1_2_0_openapi_yaml__validate index f39d8ab67..78f19e1b5 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/1password_com_events_1_2_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/1password_com_events_1_2_0_openapi_yaml__validate @@ -1 +1,10 @@ -invalid components: request body "AuditEventsRequest": invalid example: example Continuing cursor: input matches more than one oneOf schemas +invalid components: schema "AuditEvent": invalid example: unhandled value of type time.Time +Schema: + { + "example": "2020-06-11T16:32:50-03:00", + "format": "date-time", + "type": "string" + } + +Value: + "2020-06-11T16:32:50-03:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalanceControlService_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalanceControlService_1_openapi_yaml__validate new file mode 100644 index 000000000..e19288c10 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalanceControlService_1_openapi_yaml__validate @@ -0,0 +1,10 @@ +invalid paths: invalid path /balanceTransfer: invalid operation POST: invalid example: example post-balance-transfer: Error at "/createdAt": unhandled value of type time.Time +Schema: + { + "description": "The date when the balance transfer was requested.", + "format": "date-time", + "type": "string" + } + +Value: + "2022-01-24T14:59:11+01:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalancePlatformPaymentNotification_v1_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalancePlatformPaymentNotification_v1_1_openapi_yaml__validate new file mode 100644 index 000000000..4a96b2610 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalancePlatformPaymentNotification_v1_1_openapi_yaml__validate @@ -0,0 +1,10 @@ +invalid webhooks: webhook "balancePlatform.incomingTransfer.created": invalid operation POST: invalid example: example balancePlatform-incomingTransfer-created: Error at "/data/creationDate": unhandled value of type time.Time +Schema: + { + "description": "The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.", + "format": "date-time", + "type": "string" + } + +Value: + "2021-05-03T15:20:14+02:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalancePlatformReportNotification_v1_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalancePlatformReportNotification_v1_1_openapi_yaml__validate new file mode 100644 index 000000000..6536ab44e --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalancePlatformReportNotification_v1_1_openapi_yaml__validate @@ -0,0 +1,10 @@ +invalid webhooks: webhook "balancePlatform.report.created": invalid operation POST: invalid example: example balancePlatform.report.created: Error at "/data/creationDate": unhandled value of type time.Time +Schema: + { + "description": "The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.", + "format": "date-time", + "type": "string" + } + +Value: + "2021-07-02T02:01:08+02:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_37_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_37_openapi_yaml__load index 902879ef1..600b4ea6a 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_37_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_37_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 4971: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 4971: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_40_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_40_openapi_yaml__load index 01edf3ae1..62c48deaa 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_40_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_40_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5279: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5279: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_41_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_41_openapi_yaml__load index 6c4628c14..f0e607f51 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_41_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_41_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5364: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5364: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_46_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_46_openapi_yaml__load index 253010369..cd68be2ac 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_46_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_46_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5365: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5365: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_49_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_49_openapi_yaml__load index 279a03b98..8128eb958 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_49_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_49_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5375: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5375: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_50_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_50_openapi_yaml__load index 426e3b15b..906a6e29d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_50_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_50_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5433: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5433: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_51_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_51_openapi_yaml__load index 097ec6932..e969d9153 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_51_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_51_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5435: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5435: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_52_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_52_openapi_yaml__load index 6c1420bd4..a3a07f381 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_52_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_52_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5441: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5441: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_53_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_53_openapi_yaml__load index 6c1420bd4..a3a07f381 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_53_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_53_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5441: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5441: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_64_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_64_openapi_yaml__load index 6c1420bd4..a3a07f381 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_64_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_64_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5441: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5441: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_65_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_65_openapi_yaml__load index 4a31bfe54..b6763b9db 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_65_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_65_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5456: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5456: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_66_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_66_openapi_yaml__load index 4a31bfe54..b6763b9db 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_66_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_66_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5456: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5456: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_67_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_67_openapi_yaml__load index e6fe6ddef..8e2627520 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_67_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_67_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5410: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5410: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_68_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_68_openapi_yaml__load index c0210c8b9..7297a1030 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_68_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_68_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 4685: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 4685: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_69_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_69_openapi_yaml__load index c8c9e7e90..4d22dd9e4 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_69_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_69_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 4730: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 4730: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_70_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_70_openapi_yaml__load index a0b2b1c49..5a419976b 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_70_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_70_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 4776: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 4776: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_v71_71_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_v71_71_openapi_yaml__load index ba2850b0d..827845a98 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_v71_71_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_v71_71_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 4772: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 4772: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementNotificationService_v1_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementNotificationService_v1_1_openapi_yaml__validate index 5b041fdc7..a1dea40b6 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementNotificationService_v1_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementNotificationService_v1_1_openapi_yaml__validate @@ -1,63 +1,10 @@ -invalid webhooks: webhook "merchant.updated": invalid operation POST: invalid example: example merchant-updated-with-errors: Error at "/data/capabilities/receivePayments/problems/0/verificationErrors/0/code": value must be a string +invalid webhooks: webhook "merchant.created": invalid operation POST: invalid example: example merchant.created: Error at "/createdAt": unhandled value of type time.Time Schema: { - "description": "The verification error code.", + "description": "Timestamp for when the webhook was created.", + "format": "date-time", "type": "string" } Value: - 28064 - | Error at "/data/capabilities/receivePayments/problems/0/verificationErrors/0/remediatingActions/0/code": value must be a string -Schema: - { - "description": "The remediating action code.", - "type": "string" - } - -Value: - 2123 - | Error at "/data/capabilities/receivePayments/problems/0/verificationErrors/1/code": value must be a string -Schema: - { - "description": "The verification error code.", - "type": "string" - } - -Value: - 130 - | Error at "/data/capabilities/receivePayments/problems/0/verificationErrors/1/remediatingActions/0/code": value must be a string -Schema: - { - "description": "The remediating action code.", - "type": "string" - } - -Value: - 1300 - | Error at "/data/capabilities/receivePayments/problems/0/verificationErrors/1/subErrors/0/code": value must be a string -Schema: - { - "description": "The verification error code.", - "type": "string" - } - -Value: - 13000 - | Error at "/data/capabilities/receivePayments/problems/0/verificationErrors/1/subErrors/0/remediatingActions/0/code": value must be a string -Schema: - { - "description": "The remediating action code.", - "type": "string" - } - -Value: - 1300 - | Error at "/data/capabilities/receivePayments/problems/0/verificationErrors/1/subErrors/0/remediatingActions/1/code": value must be a string -Schema: - { - "description": "The remediating action code.", - "type": "string" - } - -Value: - 1301 + "2022-08-12T10:50:01+02:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementService_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementService_1_openapi_yaml__validate index a66c7bdb6..4a5c89b81 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementService_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementService_1_openapi_yaml__validate @@ -1,9 +1,40 @@ -invalid paths: invalid path /terminals/scheduleActions: invalid operation POST: invalid example: example verification-error: Error at "/errorCode": value must be a string +invalid paths: invalid path /companies/{companyId}/androidCertificates: invalid operation GET: invalid example: example success: Error at "/data/0/notAfter": unhandled value of type time.Time Schema: { - "description": "A code that identifies the problem type.", + "description": "The date when the certificate stops to be valid.", + "format": "date-time", "type": "string" } Value: - 1029 + "2038-04-12T00:00:00+02:00" + | Error at "/data/0/notBefore": unhandled value of type time.Time +Schema: + { + "description": "The date when the certificate starts to be valid.", + "format": "date-time", + "type": "string" + } + +Value: + "2008-04-20T00:00:00+02:00" + | Error at "/data/1/notAfter": unhandled value of type time.Time +Schema: + { + "description": "The date when the certificate stops to be valid.", + "format": "date-time", + "type": "string" + } + +Value: + "2048-04-12T00:00:00+02:00" + | Error at "/data/1/notBefore": unhandled value of type time.Time +Schema: + { + "description": "The date when the certificate starts to be valid.", + "format": "date-time", + "type": "string" + } + +Value: + "2008-04-20T00:00:00+02:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementService_v3_3_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementService_v3_3_openapi_yaml__validate index a66c7bdb6..4a5c89b81 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementService_v3_3_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementService_v3_3_openapi_yaml__validate @@ -1,9 +1,40 @@ -invalid paths: invalid path /terminals/scheduleActions: invalid operation POST: invalid example: example verification-error: Error at "/errorCode": value must be a string +invalid paths: invalid path /companies/{companyId}/androidCertificates: invalid operation GET: invalid example: example success: Error at "/data/0/notAfter": unhandled value of type time.Time Schema: { - "description": "A code that identifies the problem type.", + "description": "The date when the certificate stops to be valid.", + "format": "date-time", "type": "string" } Value: - 1029 + "2038-04-12T00:00:00+02:00" + | Error at "/data/0/notBefore": unhandled value of type time.Time +Schema: + { + "description": "The date when the certificate starts to be valid.", + "format": "date-time", + "type": "string" + } + +Value: + "2008-04-20T00:00:00+02:00" + | Error at "/data/1/notAfter": unhandled value of type time.Time +Schema: + { + "description": "The date when the certificate stops to be valid.", + "format": "date-time", + "type": "string" + } + +Value: + "2048-04-12T00:00:00+02:00" + | Error at "/data/1/notBefore": unhandled value of type time.Time +Schema: + { + "description": "The date when the certificate starts to be valid.", + "format": "date-time", + "type": "string" + } + +Value: + "2008-04-20T00:00:00+02:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_4_openapi_yaml__validate index 3280c1b01..213bddfbd 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_4_openapi_yaml__validate @@ -1,6 +1,11 @@ -invalid webhooks: webhook "/ACCOUNT_CLOSED": invalid operation POST: invalid example: example accountClosed: validation failed due to: at '': got string, want object +invalid webhooks: webhook "/ACCOUNT_CLOSED": invalid operation POST: invalid example: example accountClosed: Error at "/eventDate": unhandled value of type time.Time Schema: - null + { + "description": "The date and time when an event has been completed.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "4" + } Value: - null + "2019-01-01T01:00:00+01:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_5_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_5_openapi_yaml__validate index 3280c1b01..213bddfbd 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_5_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_5_openapi_yaml__validate @@ -1,6 +1,11 @@ -invalid webhooks: webhook "/ACCOUNT_CLOSED": invalid operation POST: invalid example: example accountClosed: validation failed due to: at '': got string, want object +invalid webhooks: webhook "/ACCOUNT_CLOSED": invalid operation POST: invalid example: example accountClosed: Error at "/eventDate": unhandled value of type time.Time Schema: - null + { + "description": "The date and time when an event has been completed.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "4" + } Value: - null + "2019-01-01T01:00:00+01:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_6_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_6_openapi_yaml__validate index 3280c1b01..213bddfbd 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_6_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_6_openapi_yaml__validate @@ -1,6 +1,11 @@ -invalid webhooks: webhook "/ACCOUNT_CLOSED": invalid operation POST: invalid example: example accountClosed: validation failed due to: at '': got string, want object +invalid webhooks: webhook "/ACCOUNT_CLOSED": invalid operation POST: invalid example: example accountClosed: Error at "/eventDate": unhandled value of type time.Time Schema: - null + { + "description": "The date and time when an event has been completed.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "4" + } Value: - null + "2019-01-01T01:00:00+01:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_25_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_25_openapi_yaml__load index 67d2323f8..d0ddc2d76 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_25_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_25_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 964: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 964: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_30_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_30_openapi_yaml__load index 14aaec114..a54c3ace2 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_30_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_30_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1158: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1158: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_40_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_40_openapi_yaml__load index 238ecf375..41d00cc98 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_40_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_40_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1562: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1562: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_46_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_46_openapi_yaml__load index 238ecf375..41d00cc98 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_46_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_46_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1562: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1562: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_49_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_49_openapi_yaml__load index 238ecf375..41d00cc98 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_49_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_49_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1562: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1562: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_50_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_50_openapi_yaml__load index 9ff4f6619..5a583a987 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_50_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_50_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1575: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1575: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_51_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_51_openapi_yaml__load index 9cf7a1624..e4447e976 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_51_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_51_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1647: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1647: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_52_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_52_openapi_yaml__load index 9cf7a1624..e4447e976 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_52_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_52_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1647: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1647: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_64_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_64_openapi_yaml__load index 9cf7a1624..e4447e976 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_64_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_64_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1647: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1647: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_67_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_67_openapi_yaml__load index 9cf7a1624..e4447e976 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_67_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_67_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1647: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1647: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_68_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_68_openapi_yaml__load index a113cdfeb..508bf8a06 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_68_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_68_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1808: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1808: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_30_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_30_openapi_yaml__validate new file mode 100644 index 000000000..03b5de802 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_30_openapi_yaml__validate @@ -0,0 +1,11 @@ +invalid paths: invalid path /storeDetail: invalid operation POST: invalid example: example storeDetail: Error at "/dateOfBirth": unhandled value of type time.Time +Schema: + { + "description": "The date of birth.\nFormat: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD\nFor Paysafecard it must be the same as used when registering the Paysafecard account.\n\u003e This field is mandatory for natural persons.", + "format": "date", + "type": "string", + "x-addedInVersion": "24" + } + +Value: + "1990-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_40_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_40_openapi_yaml__validate new file mode 100644 index 000000000..03b5de802 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_40_openapi_yaml__validate @@ -0,0 +1,11 @@ +invalid paths: invalid path /storeDetail: invalid operation POST: invalid example: example storeDetail: Error at "/dateOfBirth": unhandled value of type time.Time +Schema: + { + "description": "The date of birth.\nFormat: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD\nFor Paysafecard it must be the same as used when registering the Paysafecard account.\n\u003e This field is mandatory for natural persons.", + "format": "date", + "type": "string", + "x-addedInVersion": "24" + } + +Value: + "1990-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_46_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_46_openapi_yaml__load index 36ba354c8..325474a9d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_46_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_46_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 541: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 541: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_49_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_49_openapi_yaml__load index 36ba354c8..325474a9d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_49_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_49_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 541: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 541: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_50_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_50_openapi_yaml__validate new file mode 100644 index 000000000..03b5de802 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_50_openapi_yaml__validate @@ -0,0 +1,11 @@ +invalid paths: invalid path /storeDetail: invalid operation POST: invalid example: example storeDetail: Error at "/dateOfBirth": unhandled value of type time.Time +Schema: + { + "description": "The date of birth.\nFormat: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD\nFor Paysafecard it must be the same as used when registering the Paysafecard account.\n\u003e This field is mandatory for natural persons.", + "format": "date", + "type": "string", + "x-addedInVersion": "24" + } + +Value: + "1990-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_51_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_51_openapi_yaml__validate new file mode 100644 index 000000000..03b5de802 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_51_openapi_yaml__validate @@ -0,0 +1,11 @@ +invalid paths: invalid path /storeDetail: invalid operation POST: invalid example: example storeDetail: Error at "/dateOfBirth": unhandled value of type time.Time +Schema: + { + "description": "The date of birth.\nFormat: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD\nFor Paysafecard it must be the same as used when registering the Paysafecard account.\n\u003e This field is mandatory for natural persons.", + "format": "date", + "type": "string", + "x-addedInVersion": "24" + } + +Value: + "1990-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_52_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_52_openapi_yaml__validate new file mode 100644 index 000000000..03b5de802 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_52_openapi_yaml__validate @@ -0,0 +1,11 @@ +invalid paths: invalid path /storeDetail: invalid operation POST: invalid example: example storeDetail: Error at "/dateOfBirth": unhandled value of type time.Time +Schema: + { + "description": "The date of birth.\nFormat: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD\nFor Paysafecard it must be the same as used when registering the Paysafecard account.\n\u003e This field is mandatory for natural persons.", + "format": "date", + "type": "string", + "x-addedInVersion": "24" + } + +Value: + "1990-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_64_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_64_openapi_yaml__validate new file mode 100644 index 000000000..03b5de802 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_64_openapi_yaml__validate @@ -0,0 +1,11 @@ +invalid paths: invalid path /storeDetail: invalid operation POST: invalid example: example storeDetail: Error at "/dateOfBirth": unhandled value of type time.Time +Schema: + { + "description": "The date of birth.\nFormat: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD\nFor Paysafecard it must be the same as used when registering the Paysafecard account.\n\u003e This field is mandatory for natural persons.", + "format": "date", + "type": "string", + "x-addedInVersion": "24" + } + +Value: + "1990-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_67_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_67_openapi_yaml__validate new file mode 100644 index 000000000..03b5de802 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_67_openapi_yaml__validate @@ -0,0 +1,11 @@ +invalid paths: invalid path /storeDetail: invalid operation POST: invalid example: example storeDetail: Error at "/dateOfBirth": unhandled value of type time.Time +Schema: + { + "description": "The date of birth.\nFormat: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD\nFor Paysafecard it must be the same as used when registering the Paysafecard account.\n\u003e This field is mandatory for natural persons.", + "format": "date", + "type": "string", + "x-addedInVersion": "24" + } + +Value: + "1990-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_68_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_68_openapi_yaml__validate new file mode 100644 index 000000000..03b5de802 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_68_openapi_yaml__validate @@ -0,0 +1,11 @@ +invalid paths: invalid path /storeDetail: invalid operation POST: invalid example: example storeDetail: Error at "/dateOfBirth": unhandled value of type time.Time +Schema: + { + "description": "The date of birth.\nFormat: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD\nFor Paysafecard it must be the same as used when registering the Paysafecard account.\n\u003e This field is mandatory for natural persons.", + "format": "date", + "type": "string", + "x-addedInVersion": "24" + } + +Value: + "1990-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_25_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_25_openapi_yaml__validate new file mode 100644 index 000000000..9ab6e53b9 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_25_openapi_yaml__validate @@ -0,0 +1,9 @@ +invalid paths: invalid path /notifyShopper: invalid operation POST: invalid example: example notifyShopperOfUpcomingRecurringPayment: Error at "/billingDate": unhandled value of type time.Time +Schema: + { + "description": "Date on which the subscription amount will be debited from the shopper. In YYYY-MM-DD format", + "type": "string" + } + +Value: + "2021-03-16T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_30_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_30_openapi_yaml__validate new file mode 100644 index 000000000..9ab6e53b9 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_30_openapi_yaml__validate @@ -0,0 +1,9 @@ +invalid paths: invalid path /notifyShopper: invalid operation POST: invalid example: example notifyShopperOfUpcomingRecurringPayment: Error at "/billingDate": unhandled value of type time.Time +Schema: + { + "description": "Date on which the subscription amount will be debited from the shopper. In YYYY-MM-DD format", + "type": "string" + } + +Value: + "2021-03-16T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_40_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_40_openapi_yaml__validate new file mode 100644 index 000000000..9ab6e53b9 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_40_openapi_yaml__validate @@ -0,0 +1,9 @@ +invalid paths: invalid path /notifyShopper: invalid operation POST: invalid example: example notifyShopperOfUpcomingRecurringPayment: Error at "/billingDate": unhandled value of type time.Time +Schema: + { + "description": "Date on which the subscription amount will be debited from the shopper. In YYYY-MM-DD format", + "type": "string" + } + +Value: + "2021-03-16T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_49_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_49_openapi_yaml__validate new file mode 100644 index 000000000..9ab6e53b9 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_49_openapi_yaml__validate @@ -0,0 +1,9 @@ +invalid paths: invalid path /notifyShopper: invalid operation POST: invalid example: example notifyShopperOfUpcomingRecurringPayment: Error at "/billingDate": unhandled value of type time.Time +Schema: + { + "description": "Date on which the subscription amount will be debited from the shopper. In YYYY-MM-DD format", + "type": "string" + } + +Value: + "2021-03-16T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_67_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_67_openapi_yaml__validate new file mode 100644 index 000000000..9ab6e53b9 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_67_openapi_yaml__validate @@ -0,0 +1,9 @@ +invalid paths: invalid path /notifyShopper: invalid operation POST: invalid example: example notifyShopperOfUpcomingRecurringPayment: Error at "/billingDate": unhandled value of type time.Time +Schema: + { + "description": "Date on which the subscription amount will be debited from the shopper. In YYYY-MM-DD format", + "type": "string" + } + +Value: + "2021-03-16T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_68_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_68_openapi_yaml__validate new file mode 100644 index 000000000..9ab6e53b9 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_68_openapi_yaml__validate @@ -0,0 +1,9 @@ +invalid paths: invalid path /notifyShopper: invalid operation POST: invalid example: example notifyShopperOfUpcomingRecurringPayment: Error at "/billingDate": unhandled value of type time.Time +Schema: + { + "description": "Date on which the subscription amount will be debited from the shopper. In YYYY-MM-DD format", + "type": "string" + } + +Value: + "2021-03-16T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_2_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_2_openapi_yaml__validate new file mode 100644 index 000000000..a6ea48ba4 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_2_openapi_yaml__validate @@ -0,0 +1,99 @@ +invalid paths: invalid path /transactions: invalid operation GET: invalid example: example success: Error at "/data/0/bookingDate": unhandled value of type time.Time +Schema: + { + "description": "The date the transaction was booked into the balance account.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2022-03-11T11:21:24+01:00" + | Error at "/data/0/createdAt": unhandled value of type time.Time +Schema: + { + "description": "The date the transaction was created.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2022-03-11T11:21:24+01:00" + | Error at "/data/0/valueDate": unhandled value of type time.Time +Schema: + { + "description": "The date the transfer amount becomes available in the balance account.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2022-03-11T11:21:24+01:00" + | Error at "/data/1/bookingDate": unhandled value of type time.Time +Schema: + { + "description": "The date the transaction was booked into the balance account.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2022-03-12T14:22:52+01:00" + | Error at "/data/1/createdAt": unhandled value of type time.Time +Schema: + { + "description": "The date the transaction was created.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2022-03-12T14:22:52+01:00" + | Error at "/data/1/valueDate": unhandled value of type time.Time +Schema: + { + "description": "The date the transfer amount becomes available in the balance account.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2022-03-12T14:22:52+01:00" + | Error at "/data/2/bookingDate": unhandled value of type time.Time +Schema: + { + "description": "The date the transaction was booked into the balance account.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2022-03-14T21:00:48+01:00" + | Error at "/data/2/createdAt": unhandled value of type time.Time +Schema: + { + "description": "The date the transaction was created.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2022-03-14T15:00:00+01:00" + | Error at "/data/2/valueDate": unhandled value of type time.Time +Schema: + { + "description": "The date the transfer amount becomes available in the balance account.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2022-03-14T21:00:48+01:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_3_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_3_openapi_yaml__validate new file mode 100644 index 000000000..a6ea48ba4 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_3_openapi_yaml__validate @@ -0,0 +1,99 @@ +invalid paths: invalid path /transactions: invalid operation GET: invalid example: example success: Error at "/data/0/bookingDate": unhandled value of type time.Time +Schema: + { + "description": "The date the transaction was booked into the balance account.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2022-03-11T11:21:24+01:00" + | Error at "/data/0/createdAt": unhandled value of type time.Time +Schema: + { + "description": "The date the transaction was created.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2022-03-11T11:21:24+01:00" + | Error at "/data/0/valueDate": unhandled value of type time.Time +Schema: + { + "description": "The date the transfer amount becomes available in the balance account.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2022-03-11T11:21:24+01:00" + | Error at "/data/1/bookingDate": unhandled value of type time.Time +Schema: + { + "description": "The date the transaction was booked into the balance account.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2022-03-12T14:22:52+01:00" + | Error at "/data/1/createdAt": unhandled value of type time.Time +Schema: + { + "description": "The date the transaction was created.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2022-03-12T14:22:52+01:00" + | Error at "/data/1/valueDate": unhandled value of type time.Time +Schema: + { + "description": "The date the transfer amount becomes available in the balance account.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2022-03-12T14:22:52+01:00" + | Error at "/data/2/bookingDate": unhandled value of type time.Time +Schema: + { + "description": "The date the transaction was booked into the balance account.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2022-03-14T21:00:48+01:00" + | Error at "/data/2/createdAt": unhandled value of type time.Time +Schema: + { + "description": "The date the transaction was created.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2022-03-14T15:00:00+01:00" + | Error at "/data/2/valueDate": unhandled value of type time.Time +Schema: + { + "description": "The date the transfer amount becomes available in the balance account.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2022-03-14T21:00:48+01:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_v4_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_v4_4_openapi_yaml__validate new file mode 100644 index 000000000..94c9d5c6c --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_v4_4_openapi_yaml__validate @@ -0,0 +1,128 @@ +invalid paths: invalid path /transactions: invalid operation GET: invalid example: example success: Error at "/data/0/bookingDate": unhandled value of type time.Time +Schema: + { + "description": "The date the transaction was booked into the balance account.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2023-08-10T14:51:33+02:00" + | Error at "/data/0/creationDate": unhandled value of type time.Time +Schema: + { + "description": "The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.", + "format": "date-time", + "type": "string" + } + +Value: + "2023-08-10T14:51:20+02:00" + | Error at "/data/0/valueDate": unhandled value of type time.Time +Schema: + { + "description": "The date the transfer amount becomes available in the balance account.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2023-08-10T14:51:20+02:00" + | Error at "/data/1/bookingDate": unhandled value of type time.Time +Schema: + { + "description": "The date the transaction was booked into the balance account.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2023-08-10T15:34:40+02:00" + | Error at "/data/1/creationDate": unhandled value of type time.Time +Schema: + { + "description": "The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.", + "format": "date-time", + "type": "string" + } + +Value: + "2023-08-10T15:34:31+02:00" + | Error at "/data/1/valueDate": unhandled value of type time.Time +Schema: + { + "description": "The date the transfer amount becomes available in the balance account.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2023-08-10T15:34:31+02:00" + | Error at "/data/2/bookingDate": unhandled value of type time.Time +Schema: + { + "description": "The date the transaction was booked into the balance account.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2023-08-11T13:45:57+02:00" + | Error at "/data/2/creationDate": unhandled value of type time.Time +Schema: + { + "description": "The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.", + "format": "date-time", + "type": "string" + } + +Value: + "2023-08-11T13:45:46+02:00" + | Error at "/data/2/valueDate": unhandled value of type time.Time +Schema: + { + "description": "The date the transfer amount becomes available in the balance account.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2023-08-11T13:45:46+02:00" + | Error at "/data/3/bookingDate": unhandled value of type time.Time +Schema: + { + "description": "The date the transaction was booked into the balance account.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2023-08-11T13:45:58+02:00" + | Error at "/data/3/creationDate": unhandled value of type time.Time +Schema: + { + "description": "The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.", + "format": "date-time", + "type": "string" + } + +Value: + "2023-08-11T13:45:51+02:00" + | Error at "/data/3/valueDate": unhandled value of type time.Time +Schema: + { + "description": "The date the transfer amount becomes available in the balance account.", + "format": "date-time", + "type": "string", + "x-addedInVersion": "1" + } + +Value: + "2023-08-11T13:45:51+02:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_2_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_2_2_0_openapi_yaml__validate index d72346952..387ff5f84 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_2_2_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_2_2_0_openapi_yaml__validate @@ -1,28 +1,11 @@ -invalid components: schema "Error_400": invalid example: Error at "/errors/0/source": there must be at most 1 properties +invalid components: schema "DateTimeRange": invalid example: unhandled value of type time.Time Schema: { - "description": "an object containing references to the source of the error", - "maxProperties": 1, - "properties": { - "example": { - "description": "a string indicating an example of the right value", - "type": "string" - }, - "parameter": { - "description": "a string indicating which URI query parameter caused the issue", - "type": "string" - }, - "pointer": { - "description": "a JSON Pointer [RFC6901] to the associated entity in the request document", - "type": "string" - } - }, - "title": "Issue_Source", - "type": "object" + "description": "Dates are specified in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) YYYY-MM-DD format, e.g. 2018-12-25", + "example": "2018-09-22T00:00:00Z", + "format": "date", + "type": "string" } Value: - { - "example": "CDG", - "parameter": "airport" - } + "2018-09-22T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_amadeus_flight_price_analysis_1_0_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_amadeus_flight_price_analysis_1_0_1_openapi_yaml__validate index 0df4e457c..a99a5833b 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_amadeus_flight_price_analysis_1_0_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_amadeus_flight_price_analysis_1_0_1_openapi_yaml__validate @@ -1,9 +1,8 @@ -invalid paths: invalid path /analytics/itinerary-price-metrics: invalid operation GET: parameter "oneWay" schema is invalid: invalid default: value must be a boolean +invalid paths: invalid path /analytics/itinerary-price-metrics: invalid operation GET: invalid example: unhandled value of type time.Time Schema: { - "default": "false", - "type": "boolean" + "type": "string" } Value: - "false" + "2021-03-21T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_amadeus_trip_parser_3_0_1_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_amadeus_trip_parser_3_0_1_openapi_yaml__load index 10b861a73..9600eeaf7 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_amadeus_trip_parser_3_0_1_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_amadeus_trip_parser_3_0_1_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 275: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 275: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/api_gov_uk_vehicle_enquiry_1_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/api_gov_uk_vehicle_enquiry_1_1_0_openapi_yaml__validate index eedccb65a..4b60ad6bd 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/api_gov_uk_vehicle_enquiry_1_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/api_gov_uk_vehicle_enquiry_1_1_0_openapi_yaml__validate @@ -1 +1,11 @@ -invalid components: schema "Vehicle": invalid example: string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" +invalid components: schema "Vehicle": invalid example: unhandled value of type time.Time +Schema: + { + "description": "Additional Rate of Tax End Date, format: YYYY-MM-DD", + "example": "2007-12-25T00:00:00Z", + "format": "date", + "type": "string" + } + +Value: + "2007-12-25T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_accounting_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_accounting_10_0_0_openapi_yaml__validate index 25cc35b55..e49edbe06 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_accounting_10_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_accounting_10_0_0_openapi_yaml__validate @@ -1,48 +1,14 @@ -invalid components: schema "GetProfitAndLossResponse": invalid anyOf element: invalid example: Error at "/type": property "type" is missing +invalid components: schema "AccountingCustomer": invalid example: unhandled value of type time.Time Schema: { - "example": { - "total": 200000 - }, - "properties": { - "id": { - "example": "123abc", - "nullable": true, - "type": "string" - }, - "records": { - "$ref": "#/components/schemas/ProfitAndLossRecords" - }, - "title": { - "example": "Income", - "nullable": true, - "type": "string" - }, - "total": { - "example": 23992.34, - "nullable": true, - "type": "number" - }, - "type": { - "example": "Section", - "type": "string" - } - }, - "required": [ - "type" - ], - "type": "object", - "x-apideck-schema-id": "ProfitAndLossSection", - "x-apideck-weights": { - "id": "medium", - "records": "medium", - "title": "medium", - "total": "medium", - "type": "critical" - } + "description": "The date and time when the object was created.", + "example": "2020-09-30T07:43:32Z", + "format": "date-time", + "nullable": true, + "readOnly": true, + "title": "Created at (timestamp)", + "type": "string" } Value: - { - "total": 200000 - } + "2020-09-30T07:43:32Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_ats_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_ats_10_0_0_openapi_yaml__validate new file mode 100644 index 000000000..253cdce02 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_ats_10_0_0_openapi_yaml__validate @@ -0,0 +1,13 @@ +invalid components: schema "Applicant": invalid example: unhandled value of type time.Time +Schema: + { + "description": "The date of birth of the person.", + "example": "2000-08-12T00:00:00Z", + "format": "date", + "nullable": true, + "title": "Birth Date", + "type": "string" + } + +Value: + "2000-08-12T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_crm_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_crm_10_0_0_openapi_yaml__validate new file mode 100644 index 000000000..3312ae9cc --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_crm_10_0_0_openapi_yaml__validate @@ -0,0 +1,11 @@ +invalid components: schema "ActivitiesFilter": invalid example: unhandled value of type time.Time +Schema: + { + "example": "2020-09-30T07:43:32Z", + "format": "date-time", + "title": "Updated since (timestamp)", + "type": "string" + } + +Value: + "2020-09-30T07:43:32Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_customer_support_9_5_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_customer_support_9_5_0_openapi_yaml__validate new file mode 100644 index 000000000..d0ec9e7c7 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_customer_support_9_5_0_openapi_yaml__validate @@ -0,0 +1,13 @@ +invalid components: schema "Company": invalid example: unhandled value of type time.Time +Schema: + { + "description": "The date of birth of the person.", + "example": "2000-08-12T00:00:00Z", + "format": "date", + "nullable": true, + "title": "Birth Date", + "type": "string" + } + +Value: + "2000-08-12T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_ecommerce_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_ecommerce_10_0_0_openapi_yaml__validate new file mode 100644 index 000000000..505169060 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_ecommerce_10_0_0_openapi_yaml__validate @@ -0,0 +1,14 @@ +invalid components: schema "CreatedAt": invalid example: unhandled value of type time.Time +Schema: + { + "description": "The date and time when the object was created.", + "example": "2020-09-30T07:43:32Z", + "format": "date-time", + "nullable": true, + "readOnly": true, + "title": "Created at (timestamp)", + "type": "string" + } + +Value: + "2020-09-30T07:43:32Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_file_storage_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_file_storage_10_0_0_openapi_yaml__validate new file mode 100644 index 000000000..505169060 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_file_storage_10_0_0_openapi_yaml__validate @@ -0,0 +1,14 @@ +invalid components: schema "CreatedAt": invalid example: unhandled value of type time.Time +Schema: + { + "description": "The date and time when the object was created.", + "example": "2020-09-30T07:43:32Z", + "format": "date-time", + "nullable": true, + "readOnly": true, + "title": "Created at (timestamp)", + "type": "string" + } + +Value: + "2020-09-30T07:43:32Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_hris_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_hris_10_0_0_openapi_yaml__validate index b96310bbb..c230b11ec 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_hris_10_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_hris_10_0_0_openapi_yaml__validate @@ -1,20 +1,13 @@ -invalid components: schema "Employee": invalid example: value is not one of the allowed values ["weekly","biweekly","monthly","pro-rata","other"] +invalid components: schema "Birthday": invalid example: unhandled value of type time.Time Schema: { - "description": "Frequency of employee compensation.", - "enum": [ - "weekly", - "biweekly", - "monthly", - "pro-rata", - "other" - ], - "example": "year", + "description": "The date of birth of the person.", + "example": "2000-08-12T00:00:00Z", + "format": "date", "nullable": true, - "title": "Payment Frequency", - "type": "string", - "x-apideck-enum-id": "payment_frequency" + "title": "Birth Date", + "type": "string" } Value: - "year" + "2000-08-12T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_issue_tracking_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_issue_tracking_10_0_0_openapi_yaml__validate new file mode 100644 index 000000000..001804c22 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_issue_tracking_10_0_0_openapi_yaml__validate @@ -0,0 +1,14 @@ +invalid components: schema "Collection": invalid example: unhandled value of type time.Time +Schema: + { + "description": "The date and time when the object was created.", + "example": "2020-09-30T07:43:32Z", + "format": "date-time", + "nullable": true, + "readOnly": true, + "title": "Created at (timestamp)", + "type": "string" + } + +Value: + "2020-09-30T07:43:32Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_lead_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_lead_10_0_0_openapi_yaml__validate new file mode 100644 index 000000000..b0ee036a2 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_lead_10_0_0_openapi_yaml__validate @@ -0,0 +1,13 @@ +invalid components: schema "GetLeadResponse": invalid example: unhandled value of type time.Time +Schema: + { + "description": "Date created in ISO 8601 format", + "example": "2020-09-30T07:43:32Z", + "nullable": true, + "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$", + "readOnly": true, + "type": "string" + } + +Value: + "2020-09-30T07:43:32Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_pos_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_pos_10_0_0_openapi_yaml__validate index 1600748db..505169060 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_pos_10_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_pos_10_0_0_openapi_yaml__validate @@ -1,11 +1,14 @@ -invalid components: schema "GetOrderResponse": invalid example: value must be an integer +invalid components: schema "CreatedAt": invalid example: unhandled value of type time.Time Schema: { - "example": 27.5, + "description": "The date and time when the object was created.", + "example": "2020-09-30T07:43:32Z", + "format": "date-time", "nullable": true, - "title": "Total amount (in cents)", - "type": "integer" + "readOnly": true, + "title": "Created at (timestamp)", + "type": "string" } Value: - 27.5 + "2020-09-30T07:43:32Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_sms_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_sms_10_0_0_openapi_yaml__validate new file mode 100644 index 000000000..647cc12e8 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_sms_10_0_0_openapi_yaml__validate @@ -0,0 +1,14 @@ +invalid components: schema "GetMessageResponse": invalid example: unhandled value of type time.Time +Schema: + { + "description": "The date and time when the object was created.", + "example": "2020-09-30T07:43:32Z", + "format": "date-time", + "nullable": true, + "readOnly": true, + "title": "Created at (timestamp)", + "type": "string" + } + +Value: + "2020-09-30T07:43:32Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_vault_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_vault_10_0_0_openapi_yaml__validate new file mode 100644 index 000000000..6fa12a1df --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_vault_10_0_0_openapi_yaml__validate @@ -0,0 +1,10 @@ +invalid components: schema "Connection": invalid example: unhandled value of type time.Time +Schema: + { + "description": "The date and time the webhook subscription was created downstream", + "example": "2020-10-01T12:00:00Z", + "type": "string" + } + +Value: + "2020-10-01T12:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_webhook_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_webhook_10_0_0_openapi_yaml__validate new file mode 100644 index 000000000..54fbf86d5 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_webhook_10_0_0_openapi_yaml__validate @@ -0,0 +1,14 @@ +invalid components: schema "CreateWebhookResponse": invalid example: unhandled value of type time.Time +Schema: + { + "description": "The date and time when the object was created.", + "example": "2020-09-30T07:43:32Z", + "format": "date-time", + "nullable": true, + "readOnly": true, + "title": "Created at (timestamp)", + "type": "string" + } + +Value: + "2020-09-30T07:43:32Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apis_guru_2_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apis_guru_2_2_0_openapi_yaml__validate index 1c27e7e18..cae4b1f85 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/apis_guru_2_2_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/apis_guru_2_2_0_openapi_yaml__validate @@ -1,4 +1,34 @@ -invalid components: schema "APIs": invalid example: Error at "/googleapis.com:drive/versions/v2/openapiVer": property "openapiVer" is missing +invalid components: schema "APIs": invalid example: Error at "/googleapis.com:drive/added": unhandled value of type time.Time +Schema: + { + "description": "Timestamp when the API was first added to the directory", + "format": "date-time", + "type": "string" + } + +Value: + "2015-02-22T20:00:45Z" + | Error at "/googleapis.com:drive/versions/v2/added": unhandled value of type time.Time +Schema: + { + "description": "Timestamp when the version was added", + "format": "date-time", + "type": "string" + } + +Value: + "2015-02-22T20:00:45Z" + | Error at "/googleapis.com:drive/versions/v2/updated": unhandled value of type time.Time +Schema: + { + "description": "Timestamp when the version was updated", + "format": "date-time", + "type": "string" + } + +Value: + "2016-06-17T00:21:44Z" + | Error at "/googleapis.com:drive/versions/v2/openapiVer": property "openapiVer" is missing Schema: { "additionalProperties": false, @@ -56,7 +86,7 @@ Schema: Value: { - "added": "2015-02-22T20:00:45.000Z", + "added": "2015-02-22T20:00:45Z", "info": { "title": "Drive", "version": "v2", @@ -77,8 +107,28 @@ Value: }, "swaggerUrl": "https://api.apis.guru/v2/specs/googleapis.com/drive/v2/swagger.json", "swaggerYamlUrl": "https://api.apis.guru/v2/specs/googleapis.com/drive/v2/swagger.yaml", - "updated": "2016-06-17T00:21:44.000Z" + "updated": "2016-06-17T00:21:44Z" + } + | Error at "/googleapis.com:drive/versions/v3/added": unhandled value of type time.Time +Schema: + { + "description": "Timestamp when the version was added", + "format": "date-time", + "type": "string" + } + +Value: + "2015-12-12T00:25:13Z" + | Error at "/googleapis.com:drive/versions/v3/updated": unhandled value of type time.Time +Schema: + { + "description": "Timestamp when the version was updated", + "format": "date-time", + "type": "string" } + +Value: + "2016-06-17T00:21:44Z" | Error at "/googleapis.com:drive/versions/v3/openapiVer": property "openapiVer" is missing Schema: { @@ -137,7 +187,7 @@ Schema: Value: { - "added": "2015-12-12T00:25:13.000Z", + "added": "2015-12-12T00:25:13Z", "info": { "title": "Drive", "version": "v3", @@ -158,5 +208,5 @@ Value: }, "swaggerUrl": "https://api.apis.guru/v2/specs/googleapis.com/drive/v3/swagger.json", "swaggerYamlUrl": "https://api.apis.guru/v2/specs/googleapis.com/drive/v3/swagger.yaml", - "updated": "2016-06-17T00:21:44.000Z" + "updated": "2016-06-17T00:21:44Z" } diff --git a/openapi3/testdata/apis_guru_openapi_directory/archive_org_wayback_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/archive_org_wayback_1_0_0_openapi_yaml__validate new file mode 100644 index 000000000..0c86a77ff --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/archive_org_wayback_1_0_0_openapi_yaml__validate @@ -0,0 +1,18 @@ +invalid components: schema "AvailabilityRequests": invalid example: Error at "/0/timestamp": unhandled value of type time.Time +Schema: + { + "description": "Timestamp requested in ISO 8601 format. The following formats are acceptable: - YYYY - YYYY-MM - YYYY-MM-DD - YYYY-MM-DDTHH:mm:SSz - YYYY-MM-DD:HH:mm+00:00\n", + "type": "string" + } + +Value: + "2016-04-07T19:39:18Z" + | Error at "/2/timestamp": unhandled value of type time.Time +Schema: + { + "description": "Timestamp requested in ISO 8601 format. The following formats are acceptable: - YYYY - YYYY-MM - YYYY-MM-DD - YYYY-MM-DDTHH:mm:SSz - YYYY-MM-DD:HH:mm+00:00\n", + "type": "string" + } + +Value: + "2016-04-07T19:39:18Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/asana_com_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/asana_com_1_0_openapi_yaml__validate index 7e4988301..6efb7ab0d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/asana_com_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/asana_com_1_0_openapi_yaml__validate @@ -1,10 +1,12 @@ -invalid components: schema "BatchRequest": invalid example: value must be an integer +invalid components: schema "AttachmentResponse": invalid allOf element: invalid example: unhandled value of type time.Time Schema: { - "description": "Pagination offset for the request.", - "example": "eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9", - "type": "integer" + "description": "The time at which this resource was created.", + "example": "2012-02-22T02:06:58.147Z", + "format": "date-time", + "readOnly": true, + "type": "string" } Value: - "eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9" + "2012-02-22T02:06:58.147Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/ato_gov_au_0_0_6_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/ato_gov_au_0_0_6_openapi_yaml__validate index 798fb4a98..b779bf0b9 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/ato_gov_au_0_0_6_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/ato_gov_au_0_0_6_openapi_yaml__validate @@ -1 +1,12 @@ -invalid components: schema "address": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" +invalid components: schema "address": invalid example: unhandled value of type time.Time +Schema: + { + "description": "The date and time the resource became active in the format defined by [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601).", + "example": "1979-01-13T09:05:06+10:00", + "format": "date-time", + "readOnly": true, + "type": "string" + } + +Value: + "1979-01-13T09:05:06+10:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/box_com_2_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/box_com_2_0_0_openapi_yaml__validate index 0a626941a..7f5d659e6 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/box_com_2_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/box_com_2_0_0_openapi_yaml__validate @@ -1,300 +1,11 @@ -invalid paths: invalid path /files/{file_id}#add_shared_link: invalid operation PUT: invalid example: example default: doesn't match schema due to: doesn't match schema due to: Error at "/sequence_id": property "sequence_id" is missing +invalid components: schema "Collaboration": invalid example: unhandled value of type time.Time Schema: { - "allOf": [ - { - "$ref": "#/components/schemas/File--Base" - }, - { - "properties": { - "file_version": { - "allOf": [ - { - "$ref": "#/components/schemas/FileVersion--Mini" - }, - { - "description": "The information about the current version of the file." - } - ] - }, - "name": { - "description": "The name of the file", - "example": "Contract.pdf", - "type": "string" - }, - "sequence_id": { - "allOf": [ - { - "description": "A numeric identifier that represents the most recent user event\nthat has been applied to this item.\n\nThis can be used in combination with the `GET /events`-endpoint\nto filter out user events that would have occurred before this\nidentifier was read.\n\nAn example would be where a Box Drive-like application\nwould fetch an item via the API, and then listen to incoming\nuser events for changes to the item. The application would\nignore any user events where the `sequence_id` in the event\nis smaller than or equal to the `sequence_id` in the originally\nfetched resource.", - "example": "3", - "type": "string" - }, - {} - ] - }, - "sha1": { - "description": "The SHA1 hash of the file. This can be used to compare the contents\nof a file on Box with a local file.", - "example": "85136C79CBF9FE36BB9D05D0639C70C265C18D37", - "format": "digest", - "type": "string" - } - } - } - ], - "description": "A mini representation of a file, used when\nnested under another resource.", - "required": [ - "sequence_id", - "sha1" - ], - "title": "File (Mini)", - "type": "object", - "x-box-resource-id": "file--mini", - "x-box-variant": "mini" + "description": "When the `status` of the collaboration object changed to\n`accepted` or `rejected`.", + "example": "2012-12-12T10:55:20-08:00", + "format": "date-time", + "type": "string" } Value: - { - "etag": "1", - "id": "12345", - "shared_link": { - "access": "open", - "download_count": 0, - "download_url": "https://app.box.com/shared/static/kwio6b4ovt1264rnfbyqo1.pdf", - "effective_access": "open", - "effective_permission": "can_download", - "is_password_enabled": false, - "permissions": { - "can_download": true, - "can_edit": true, - "can_preview": true - }, - "preview_count": 0, - "unshared_at": "2020-09-21T10:34:41-07:00", - "url": "https://app.box.com/s/kwio6b4ovt1264rnfbyqo1", - "vanity_name": null, - "vanity_url": null - }, - "type": "file" - } - | Error at "/sha1": property "sha1" is missing -Schema: - { - "allOf": [ - { - "$ref": "#/components/schemas/File--Base" - }, - { - "properties": { - "file_version": { - "allOf": [ - { - "$ref": "#/components/schemas/FileVersion--Mini" - }, - { - "description": "The information about the current version of the file." - } - ] - }, - "name": { - "description": "The name of the file", - "example": "Contract.pdf", - "type": "string" - }, - "sequence_id": { - "allOf": [ - { - "description": "A numeric identifier that represents the most recent user event\nthat has been applied to this item.\n\nThis can be used in combination with the `GET /events`-endpoint\nto filter out user events that would have occurred before this\nidentifier was read.\n\nAn example would be where a Box Drive-like application\nwould fetch an item via the API, and then listen to incoming\nuser events for changes to the item. The application would\nignore any user events where the `sequence_id` in the event\nis smaller than or equal to the `sequence_id` in the originally\nfetched resource.", - "example": "3", - "type": "string" - }, - {} - ] - }, - "sha1": { - "description": "The SHA1 hash of the file. This can be used to compare the contents\nof a file on Box with a local file.", - "example": "85136C79CBF9FE36BB9D05D0639C70C265C18D37", - "format": "digest", - "type": "string" - } - } - } - ], - "description": "A mini representation of a file, used when\nnested under another resource.", - "required": [ - "sequence_id", - "sha1" - ], - "title": "File (Mini)", - "type": "object", - "x-box-resource-id": "file--mini", - "x-box-variant": "mini" - } - -Value: - { - "etag": "1", - "id": "12345", - "shared_link": { - "access": "open", - "download_count": 0, - "download_url": "https://app.box.com/shared/static/kwio6b4ovt1264rnfbyqo1.pdf", - "effective_access": "open", - "effective_permission": "can_download", - "is_password_enabled": false, - "permissions": { - "can_download": true, - "can_edit": true, - "can_preview": true - }, - "preview_count": 0, - "unshared_at": "2020-09-21T10:34:41-07:00", - "url": "https://app.box.com/s/kwio6b4ovt1264rnfbyqo1", - "vanity_name": null, - "vanity_url": null - }, - "type": "file" - } - And Error at "/shared_link": doesn't match schema due to: Error at "/accessed": property "accessed" is missing -Schema: - { - "description": "Shared links provide direct, read-only access to files or folder on Box.\n\nShared links with open access level allow anyone with the URL\nto access the item, while shared links with company or collaborators access\nlevels can only be accessed by appropriately authenticated Box users.", - "properties": { - "access": { - "description": "The access level for this shared link.\n\n* `open` - provides access to this item to anyone with this link\n* `company` - only provides access to this item to people the same company\n* `collaborators` - only provides access to this item to people who are\n collaborators on this item\n\nIf this field is omitted when creating the shared link, the access level\nwill be set to the default access level specified by the enterprise admin.", - "enum": [ - "open", - "company", - "collaborators" - ], - "example": "open", - "type": "string" - }, - "download_count": { - "description": "The number of times this item has been downloaded.", - "example": 3, - "type": "integer" - }, - "download_url": { - "description": "A URL that can be used to download the file. This URL can be used in\na browser to download the file. This URL includes the file\nextension so that the file will be saved with the right file type.\n\nThis property will be `null` for folders.", - "example": "https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg", - "format": "url", - "nullable": true, - "type": "string", - "x-box-premium-feature": true - }, - "effective_access": { - "description": "The effective access level for the shared link. This can be a more\nrestrictive access level than the value in the `access` field when the\nenterprise settings restrict the allowed access levels.", - "enum": [ - "open", - "company", - "collaborators" - ], - "example": "company", - "type": "string" - }, - "effective_permission": { - "description": "The effective permissions for this shared link.\nThese result in the more restrictive combination of\nthe share link permissions and the item permissions set\nby the administrator, the owner, and any ancestor item\nsuch as a folder.", - "enum": [ - "can_edit", - "can_download", - "can_preview", - "no_access" - ], - "example": "can_download", - "type": "string" - }, - "is_password_enabled": { - "description": "Defines if the shared link requires a password to access the item.", - "example": true, - "type": "boolean" - }, - "permissions": { - "description": "Defines if this link allows a user to preview, edit, and download an item.\nThese permissions refer to the shared link only and\ndo not supersede permissions applied to the item itself.", - "properties": { - "can_download": { - "description": "Defines if the shared link allows for the item to be downloaded. For\nshared links on folders, this also applies to any items in the folder.\n\nThis value can be set to `true` when the effective access level is\nset to `open` or `company`, not `collaborators`.", - "example": true, - "type": "boolean" - }, - "can_edit": { - "description": "Defines if the shared link allows for the item to be edited.\n\nThis value can only be `true` if `can_download` is also `true` and if\nthe item has a type of `file`.", - "example": false, - "type": "boolean" - }, - "can_preview": { - "description": "Defines if the shared link allows for the item to be previewed.\n\nThis value is always `true`. For shared links on folders this also\napplies to any items in the folder.", - "example": true, - "type": "boolean" - } - }, - "required": [ - "can_download", - "can_preview", - "can_edit" - ], - "type": "object" - }, - "preview_count": { - "description": "The number of times this item has been previewed.", - "example": 3, - "type": "integer" - }, - "unshared_at": { - "description": "The date and time when this link will be unshared. This field can only be\nset by users with paid accounts.", - "example": "2018-04-13T13:53:23-07:00", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "url": { - "description": "The URL that can be used to access the item on Box.\n\nThis URL will display the item in Box's preview UI where the file\ncan be downloaded if allowed.\n\nThis URL will continue to work even when a custom `vanity_url`\nhas been set for this shared link.", - "example": "https://www.box.com/s/vspke7y05sb214wjokpk", - "format": "url", - "type": "string" - }, - "vanity_name": { - "description": "The custom name of a shared link, as used in the `vanity_url` field.", - "example": "my_url", - "nullable": true, - "type": "string" - }, - "vanity_url": { - "description": "The \"Custom URL\" that can also be used to preview the item on Box. Custom\nURLs can only be created or modified in the Box Web application.", - "example": "https://acme.app.box.com/v/my_url/", - "format": "url", - "nullable": true, - "type": "string" - } - }, - "required": [ - "url", - "accessed", - "effective_access", - "effective_permission", - "is_password_enabled", - "download_count", - "preview_count" - ], - "title": "Shared link", - "type": "object" - } - -Value: - { - "access": "open", - "download_count": 0, - "download_url": "https://app.box.com/shared/static/kwio6b4ovt1264rnfbyqo1.pdf", - "effective_access": "open", - "effective_permission": "can_download", - "is_password_enabled": false, - "permissions": { - "can_download": true, - "can_edit": true, - "can_preview": true - }, - "preview_count": 0, - "unshared_at": "2020-09-21T10:34:41-07:00", - "url": "https://app.box.com/s/kwio6b4ovt1264rnfbyqo1", - "vanity_name": null, - "vanity_url": null - } + "2012-12-12T10:55:20-08:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/braze_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/braze_com_1_0_0_openapi_yaml__validate new file mode 100644 index 000000000..da2fa6d1e --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/braze_com_1_0_0_openapi_yaml__validate @@ -0,0 +1,9 @@ +invalid paths: invalid path /email/hard_bounces: invalid operation GET: parameter "start_date" schema is invalid: invalid example: unhandled value of type time.Time +Schema: + { + "example": "2019-01-01T00:00:00Z", + "type": "string" + } + +Value: + "2019-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/bunq_com_1_0_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/bunq_com_1_0_openapi_yaml__load index d065d5a33..44519b11a 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/bunq_com_1_0_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/bunq_com_1_0_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1142: did not find expected key +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1142: did not find expected key diff --git a/openapi3/testdata/apis_guru_openapi_directory/canada_holidays_ca_1_8_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/canada_holidays_ca_1_8_0_openapi_yaml__validate new file mode 100644 index 000000000..8ebc85807 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/canada_holidays_ca_1_8_0_openapi_yaml__validate @@ -0,0 +1,11 @@ +invalid components: schema "Error": invalid example: unhandled value of type time.Time +Schema: + { + "description": "A UTC ISO timestamp", + "example": "2020-04-27T05:41:10.71Z", + "format": "date-time", + "type": "string" + } + +Value: + "2020-04-27T05:41:10.71Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/chain49_com_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/chain49_com_2_0_openapi_yaml__validate new file mode 100644 index 000000000..f54298396 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/chain49_com_2_0_openapi_yaml__validate @@ -0,0 +1,40 @@ +invalid paths: invalid path /{blockchain}: invalid operation GET: invalid example: example Example 1: Error at "/blockbook/buildTime": unhandled value of type time.Time +Schema: + { + "type": "string" + } + +Value: + "2023-02-27T02:40:48Z" + | Error at "/blockbook/currentFiatRatesTime": unhandled value of type time.Time +Schema: + { + "type": "string" + } + +Value: + "2023-04-07T03:00:04.080770962Z" + | Error at "/blockbook/historicalFiatRatesTime": unhandled value of type time.Time +Schema: + { + "type": "string" + } + +Value: + "2023-04-07T00:00:00Z" + | Error at "/blockbook/lastBlockTime": unhandled value of type time.Time +Schema: + { + "type": "string" + } + +Value: + "2023-04-07T02:55:40.032567054Z" + | Error at "/blockbook/lastMempoolTime": unhandled value of type time.Time +Schema: + { + "type": "string" + } + +Value: + "2023-04-07T03:04:36.260327616Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/chaingateway_io_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/chaingateway_io_1_0_0_openapi_yaml__validate new file mode 100644 index 000000000..15ef2ecde --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/chaingateway_io_1_0_0_openapi_yaml__validate @@ -0,0 +1,9 @@ +invalid paths: invalid path /v2/bitcoin/webhooks/notifications/failed: invalid operation GET: invalid example: unhandled value of type time.Time +Schema: + { + "example": "2020-09-19T14:33:01Z", + "type": "string" + } + +Value: + "2020-09-19T14:33:01Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/chaingateway_io_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/chaingateway_io_1_0_openapi_yaml__validate new file mode 100644 index 000000000..d4d5b31a2 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/chaingateway_io_1_0_openapi_yaml__validate @@ -0,0 +1,8 @@ +invalid components: schema "FailedIpn": invalid example: Error at "/timestamp": unhandled value of type time.Time +Schema: + { + "type": "string" + } + +Value: + "2020-09-19T14:33:01Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/codat_io_accounting_2_1_0_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/codat_io_accounting_2_1_0_openapi_yaml__load index 711e7ca6c..429dfa06b 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/codat_io_accounting_2_1_0_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/codat_io_accounting_2_1_0_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 43981: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 43981: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/codat_io_assess_1_0_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/codat_io_assess_1_0_openapi_yaml__load index 7f6544a0b..11379f886 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/codat_io_assess_1_0_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/codat_io_assess_1_0_openapi_yaml__load @@ -1 +1,2 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal object into field Schema.examples of type []interface {} +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: unmarshal errors: + line 4692: cannot unmarshal !!map into []interface {} diff --git a/openapi3/testdata/apis_guru_openapi_directory/codat_io_bank_feeds_2_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/codat_io_bank_feeds_2_1_0_openapi_yaml__validate index a07531e10..8360d314c 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/codat_io_bank_feeds_2_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/codat_io_bank_feeds_2_1_0_openapi_yaml__validate @@ -1 +1,12 @@ -invalid components: schema "BankTransactions": extra sibling fields: [definitions] +invalid components: schema "BankFeedAccount": invalid example: unhandled value of type time.Time +Schema: + { + "description": "In Codat's data model, dates and times are represented using the \u003ca class=\"external\" href=\"https://en.wikipedia.org/wiki/ISO_8601\" target=\"_blank\"\u003eISO 8601 standard\u003c/a\u003e. Date and time fields are formatted as strings; for example:\n\n```\n2020-10-08T22:40:50Z\n2021-01-01T00:00:00\n```\n\n\n\nWhen syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:\n\n- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`\n- Unqualified local time: `2021-11-15T01:00:00`\n- UTC time offsets: `2021-11-15T01:00:00-05:00`\n\n\u003e Time zones\n\u003e \n\u003e Not all dates from Codat will contain information about time zones. \n\u003e Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced.", + "example": "2022-10-23T00:00:00Z", + "nullable": true, + "title": "Date time", + "type": "string" + } + +Value: + "2022-10-23T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/codat_io_banking_2_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/codat_io_banking_2_1_0_openapi_yaml__validate index 9cff992a4..b39c02260 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/codat_io_banking_2_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/codat_io_banking_2_1_0_openapi_yaml__validate @@ -1 +1,6 @@ -invalid components: schema "Account": extra sibling fields: [definitions] +invalid components: schema "Account": invalid allOf element: invalid example: validation failed due to: at '': invalid jsonType time.Time +Schema: + null + +Value: + null diff --git a/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_commerce_1_1_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_commerce_1_1_openapi_yaml__load index 2a6522f53..c34de6b50 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_commerce_1_1_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_commerce_1_1_openapi_yaml__load @@ -1 +1,2 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal bool into field Schema.properties of type openapi3.Schema +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: unmarshal errors: + line 751: cannot unmarshal !!bool `false` into openapi3.SchemaBis diff --git a/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_expenses_prealpha_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_expenses_prealpha_openapi_yaml__load index 2a6522f53..846fbcea7 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_expenses_prealpha_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_expenses_prealpha_openapi_yaml__load @@ -1 +1,2 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal bool into field Schema.properties of type openapi3.Schema +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: unmarshal errors: + line 766: cannot unmarshal !!bool `false` into openapi3.SchemaBis diff --git a/openapi3/testdata/apis_guru_openapi_directory/currencytick_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/currencytick_com_1_0_0_openapi_yaml__validate new file mode 100644 index 000000000..d205c4f37 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/currencytick_com_1_0_0_openapi_yaml__validate @@ -0,0 +1,10 @@ +invalid paths: invalid path /historical: invalid operation GET: parameter "date" schema is invalid: invalid example: unhandled value of type time.Time +Schema: + { + "description": "The date to get the exchange rate.", + "example": "2023-04-18T00:00:00Z", + "type": "string" + } + +Value: + "2023-04-18T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/dev_to_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/dev_to_1_0_0_openapi_yaml__validate index 0c9d736e5..7e72b5096 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/dev_to_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/dev_to_1_0_0_openapi_yaml__validate @@ -1,8 +1,37 @@ -invalid paths: invalid path /api/comments/{id}: invalid operation GET: invalid example: value must be an integer +invalid paths: invalid path /api/articles: invalid operation GET: invalid example: Error at "/0/created_at": unhandled value of type time.Time Schema: { - "type": "integer" + "format": "date-time", + "type": "string" } Value: - "321" + "2023-04-07T11:16:58Z" + | Error at "/0/last_comment_at": unhandled value of type time.Time +Schema: + { + "format": "date-time", + "type": "string" + } + +Value: + "2023-04-07T11:16:58Z" + | Error at "/0/published_at": unhandled value of type time.Time +Schema: + { + "format": "date-time", + "type": "string" + } + +Value: + "2023-04-07T11:16:58Z" + | Error at "/0/published_timestamp": unhandled value of type time.Time +Schema: + { + "description": "Crossposting or published date time", + "format": "date-time", + "type": "string" + } + +Value: + "2023-04-07T11:16:58Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/digitalnz_org_3_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/digitalnz_org_3_openapi_yaml__validate index 0391e9703..a9786f343 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/digitalnz_org_3_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/digitalnz_org_3_openapi_yaml__validate @@ -1,13 +1,14 @@ -invalid components: schema "record": invalid example: value must be an array +invalid components: schema "record": invalid example: unhandled value of type time.Time Schema: { - "description": "Date information associated with this record (e.g. 1996-01-01T00:00:00.000Z). This field may be empty.", - "example": "1996-01-01T00:00:00.000Z", - "items": { - "type": "string" - }, - "type": "array" + "description": "The date the record was initially harvested into DigitalNZ.", + "example": "2012-04-21T05:32:02+13:00", + "format": "date-time", + "type": "string", + "xml": { + "name": "created-at" + } } Value: - "1996-01-01T00:00:00.000Z" + "2012-04-21T05:32:02+13:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/docker_com_engine_1_33_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/docker_com_engine_1_33_openapi_yaml__validate index 64ed3a5f5..5e7eba9c8 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/docker_com_engine_1_33_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/docker_com_engine_1_33_openapi_yaml__validate @@ -1,17 +1,11 @@ -invalid components: schema "Network": invalid example: Error at "/IPAM/Options": value must be an array +invalid components: schema "ClusterInfo": invalid example: unhandled value of type time.Time Schema: { - "description": "Driver-specific options, specified as a map.", - "items": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "type": "array" + "description": "Date and time at which the swarm was initialised in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", + "example": "2016-08-18T10:44:24.496525531Z", + "format": "dateTime", + "type": "string" } Value: - { - "foo": "bar" - } + "2016-08-18T10:44:24.496525531Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/docker_com_hub_beta_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/docker_com_hub_beta_openapi_yaml__validate index 827224a93..15882b684 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/docker_com_hub_beta_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/docker_com_hub_beta_openapi_yaml__validate @@ -1,10 +1,11 @@ -invalid components: schema "Users2FALoginRequest": invalid example: value must be a string +invalid components: schema "GetNamespaceRepositoryImagesResponse": invalid example: unhandled value of type time.Time Schema: { - "description": "The Time-based One-Time Password of the Docker Hub account to authenticate with.", - "example": 123456, + "description": "Time when this image was last pulled. Note this is updated at most once per hour.", + "example": "2021-02-24T23:16:10.200008Z", + "nullable": true, "type": "string" } Value: - 123456 + "2021-02-24T23:16:10.200008Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/docusign_net_v2_1_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/docusign_net_v2_1_openapi_yaml__load index e5fb18fb8..f6be00efb 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/docusign_net_v2_1_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/docusign_net_v2_1_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: control characters are not allowed +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: control characters are not allowed diff --git a/openapi3/testdata/apis_guru_openapi_directory/dodo_ac_1_6_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/dodo_ac_1_6_0_openapi_yaml__validate index 60805961a..f363a1ca1 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/dodo_ac_1_6_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/dodo_ac_1_6_0_openapi_yaml__validate @@ -1,32 +1,10 @@ -invalid components: schema "NHInterior": invalid example: value is not one of the allowed values ["Aqua","Beige","Black","Blue","Brown","Colorful","Gray","Green","Orange","Pink","Purple","Red","White","Yellow"] +invalid components: schema "NHEvent": invalid example: unhandled value of type time.Time Schema: { - "description": "(WIP)", - "enum": [ - "Aqua", - "Beige", - "Black", - "Blue", - "Brown", - "Colorful", - "Gray", - "Green", - "Orange", - "Pink", - "Purple", - "Red", - "White", - "Yellow" - ], - "example": [ - "White", - "Colorful" - ], + "description": "The date of the event in YYYY-MM-DD format.", + "example": "2021-05-01T00:00:00Z", "type": "string" } Value: - [ - "White", - "Colorful" - ] + "2021-05-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/exavault_com_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/exavault_com_2_0_openapi_yaml__validate index d02359ba1..65cbb07d2 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/exavault_com_2_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/exavault_com_2_0_openapi_yaml__validate @@ -1,10 +1,11 @@ -invalid components: schema "Error": invalid example: value must be an object +invalid components: schema "Account": invalid example: unhandled value of type time.Time Schema: { - "description": "Meta object containing non-standard meta-information about the error.", - "example": "\u003c_META_OBJECT\u003e", - "type": "object" + "description": "Timestamp of account creation.", + "example": "2017-01-12T09:06:21Z", + "format": "date-time", + "type": "string" } Value: - "\u003c_META_OBJECT\u003e" + "2017-01-12T09:06:21Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/fec_gov_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/fec_gov_1_0_openapi_yaml__validate index e862e0bd1..344183a6c 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/fec_gov_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/fec_gov_1_0_openapi_yaml__validate @@ -1,4 +1,22 @@ -invalid paths: invalid path /legal/search/: invalid operation GET: invalid example: Error at "/advisory_opinions/0/documents/0/date": string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" | Error at "/murs/0/close_date": string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" | Error at "/murs/0/commission_votes/0/vote_date": string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" | Error at "/murs/0/commission_votes/1/vote_date": string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" | Error at "/murs/0/dispositions/0/penalty": Value is not nullable +invalid paths: invalid path /legal/search/: invalid operation GET: invalid example: Error at "/advisory_opinions/0/documents/0/date": string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" | Error at "/advisory_opinions/0/issue_date": unhandled value of type time.Time +Schema: + { + "format": "date", + "type": "string" + } + +Value: + "2012-06-21T00:00:00Z" + | Error at "/advisory_opinions/0/request_date": unhandled value of type time.Time +Schema: + { + "format": "date", + "type": "string" + } + +Value: + "2012-05-14T00:00:00Z" + | Error at "/murs/0/close_date": string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" | Error at "/murs/0/commission_votes/0/vote_date": string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" | Error at "/murs/0/commission_votes/1/vote_date": string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" | Error at "/murs/0/dispositions/0/penalty": Value is not nullable Schema: { "type": "number" diff --git a/openapi3/testdata/apis_guru_openapi_directory/figshare_com_2_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/figshare_com_2_0_0_openapi_yaml__validate index 365749d50..4d1248357 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/figshare_com_2_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/figshare_com_2_0_0_openapi_yaml__validate @@ -1,10 +1,10 @@ -invalid components: schema "ArticleComplete": invalid example: value must be a boolean +invalid components: schema "AccountReport": invalid example: unhandled value of type time.Time Schema: { - "description": "True if author has published items", - "example": 1, - "type": "boolean" + "description": "Date when the AccountReport was requested", + "example": "2017-05-15T15:12:26Z", + "type": "string" } Value: - 1 + "2017-05-15T15:12:26Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/files_com_0_0_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/files_com_0_0_1_openapi_yaml__validate index 557a98c05..d7f13e8ac 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/files_com_0_0_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/files_com_0_0_1_openapi_yaml__validate @@ -1,74 +1,11 @@ -invalid components: schema "AccountLineItemEntity": invalid example: Error at "/0": Value is not nullable +invalid components: schema "AccountLineItemEntity": invalid example: unhandled value of type time.Time Schema: { - "properties": { - "amount": { - "description": "Invoice line item amount", - "example": 1, - "format": "double", - "type": "number" - }, - "created_at": { - "description": "Invoice line item created at date/time", - "example": "2000-01-01T01:00:00Z", - "format": "date-time", - "type": "string" - }, - "description": { - "description": "Invoice line item description", - "example": "Service from 2019-01-01 through 2019-12-31", - "type": "string" - }, - "plan": { - "description": "Plan name", - "example": "Premier", - "type": "string" - }, - "service_end_at": { - "description": "Invoice line item service end date/time", - "example": "2000-01-01T01:00:00Z", - "format": "date-time", - "type": "string" - }, - "service_start_at": { - "description": "Invoice line item service start date/time", - "example": "2000-01-01T01:00:00Z", - "format": "date-time", - "type": "string" - }, - "site": { - "description": "Site name", - "example": "My site", - "type": "string" - }, - "type": { - "description": "Invoice line item type", - "enum": [ - "invoice", - "invoice_adjustment", - "usage_overage", - "user_overage", - "addon_subscription", - "misc_fee", - "usage_overage_adjustment", - "user_overage_adjustment", - "addon_subscription_adjustment", - "misc_fee_adjustment", - "credit_expiration" - ], - "example": "invoice", - "type": "string" - }, - "updated_at": { - "description": "Invoice line item updated date/time", - "example": "2000-01-01T01:00:00Z", - "format": "date-time", - "type": "string" - } - }, - "type": "object", - "x-docs": null + "description": "Line item created at", + "example": "2000-01-01T01:00:00Z", + "format": "date-time", + "type": "string" } Value: - null + "2000-01-01T01:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/fire_com_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/fire_com_1_0_openapi_yaml__validate index 7ad621b6c..ca8847c9b 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/fire_com_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/fire_com_1_0_openapi_yaml__validate @@ -1,9 +1,11 @@ -invalid paths: invalid path /v1/accounts/{ican}/transactions: invalid operation GET: invalid oneOf element: invalid example: value must be a string +invalid paths: invalid path /v1/accounts/{ican}/transactions: invalid operation GET: invalid example: unhandled value of type time.Time Schema: { - "example": 6011329, + "description": "Date of the transaction", + "example": "2021-04-13T11:06:32.437Z", + "format": "date-time", "type": "string" } Value: - 6011329 + "2021-04-13T11:06:32.437Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/flat_io_2_13_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/flat_io_2_13_0_openapi_yaml__validate index 540d8e223..f72b8ed7c 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/flat_io_2_13_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/flat_io_2_13_0_openapi_yaml__validate @@ -1 +1,27 @@ -invalid components: schema "ScoreTrack": invalid example: Error at "/measureUuid": string doesn't match the format "uuid": string doesn't match pattern "^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$" +invalid components: schema "Assignment": invalid example: Error at "/creationDate": unhandled value of type time.Time +Schema: + { + "description": "The date when the submission was created", + "type": "string" + } + +Value: + "2020-08-12T00:25:00.748Z" + | Error at "/returnDate": unhandled value of type time.Time +Schema: + { + "description": "The date when the teacher returned the work", + "type": "string" + } + +Value: + "2020-08-15T00:25:00.748Z" + | Error at "/submissionDate": unhandled value of type time.Time +Schema: + { + "description": "The date when the student submitted his work", + "type": "string" + } + +Value: + "2020-08-12T00:45:22.748Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/formapi_io_v1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/formapi_io_v1_openapi_yaml__validate new file mode 100644 index 000000000..616cd4562 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/formapi_io_v1_openapi_yaml__validate @@ -0,0 +1,9 @@ +invalid paths: invalid path /combined_submissions: invalid operation GET: invalid example: example response: Error at "/3/expires_at": unhandled value of type time.Time +Schema: + { + "nullable": true, + "type": "string" + } + +Value: + "2023-01-05T14:05:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/getpostman_com_1_20_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/getpostman_com_1_20_0_openapi_yaml__validate new file mode 100644 index 000000000..31d6bb3d6 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/getpostman_com_1_20_0_openapi_yaml__validate @@ -0,0 +1,9 @@ +invalid paths: invalid path /apis: invalid operation POST: invalid example: unhandled value of type time.Time +Schema: + { + "example": "2019-02-12T19:34:49Z", + "type": "string" + } + +Value: + "2019-02-12T19:34:49Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/giphy_com_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/giphy_com_1_0_openapi_yaml__validate index c75deb45f..7e3f8906e 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/giphy_com_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/giphy_com_1_0_openapi_yaml__validate @@ -1 +1,11 @@ -invalid components: schema "Gif": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" +invalid components: schema "Gif": invalid example: unhandled value of type time.Time +Schema: + { + "description": "The date this GIF was added to the GIPHY database.", + "example": "2013-08-01T12:41:48Z", + "format": "date-time", + "type": "string" + } + +Value: + "2013-08-01T12:41:48Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_api_github_com_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_api_github_com_1_1_4_openapi_yaml__validate index 3dcff6d14..b5cdccf09 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_api_github_com_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_api_github_com_1_1_4_openapi_yaml__validate @@ -1,8 +1,10 @@ -invalid components: schema "contributor-activity": invalid example: Error at "/0/w": value must be an integer +invalid components: schema "actions-cache-list": invalid example: unhandled value of type time.Time Schema: { - "type": "integer" + "example": "2019-01-24T22:45:36Z", + "format": "date-time", + "type": "string" } Value: - "1367712000" + "2019-01-24T22:45:36Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_api_github_com_2022_11_28_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_api_github_com_2022_11_28_1_1_4_openapi_yaml__validate index 3dcff6d14..b5cdccf09 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_api_github_com_2022_11_28_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_api_github_com_2022_11_28_1_1_4_openapi_yaml__validate @@ -1,8 +1,10 @@ -invalid components: schema "contributor-activity": invalid example: Error at "/0/w": value must be an integer +invalid components: schema "actions-cache-list": invalid example: unhandled value of type time.Time Schema: { - "type": "integer" + "example": "2019-01-24T22:45:36Z", + "format": "date-time", + "type": "string" } Value: - "1367712000" + "2019-01-24T22:45:36Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghec_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghec_1_1_4_openapi_yaml__validate index ac78d6dd1..b5cdccf09 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghec_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghec_1_1_4_openapi_yaml__validate @@ -1 +1,10 @@ -invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" +invalid components: schema "actions-cache-list": invalid example: unhandled value of type time.Time +Schema: + { + "example": "2019-01-24T22:45:36Z", + "format": "date-time", + "type": "string" + } + +Value: + "2019-01-24T22:45:36Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghec_2022_11_28_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghec_2022_11_28_1_1_4_openapi_yaml__validate index ac78d6dd1..b5cdccf09 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghec_2022_11_28_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghec_2022_11_28_1_1_4_openapi_yaml__validate @@ -1 +1,10 @@ -invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" +invalid components: schema "actions-cache-list": invalid example: unhandled value of type time.Time +Schema: + { + "example": "2019-01-24T22:45:36Z", + "format": "date-time", + "type": "string" + } + +Value: + "2019-01-24T22:45:36Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_18_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_18_1_1_4_openapi_yaml__validate index 3dcff6d14..0a33c55eb 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_18_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_18_1_1_4_openapi_yaml__validate @@ -1,8 +1,10 @@ -invalid components: schema "contributor-activity": invalid example: Error at "/0/w": value must be an integer +invalid components: schema "added-to-project-issue-event": invalid example: unhandled value of type time.Time Schema: { - "type": "integer" + "example": "2017-07-08T16:18:44-04:00", + "format": "date-time", + "type": "string" } Value: - "1367712000" + "2017-07-08T16:18:44-04:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_19_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_19_1_1_4_openapi_yaml__validate index 3dcff6d14..0a33c55eb 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_19_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_19_1_1_4_openapi_yaml__validate @@ -1,8 +1,10 @@ -invalid components: schema "contributor-activity": invalid example: Error at "/0/w": value must be an integer +invalid components: schema "added-to-project-issue-event": invalid example: unhandled value of type time.Time Schema: { - "type": "integer" + "example": "2017-07-08T16:18:44-04:00", + "format": "date-time", + "type": "string" } Value: - "1367712000" + "2017-07-08T16:18:44-04:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_20_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_20_1_1_4_openapi_yaml__validate index 3dcff6d14..0a33c55eb 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_20_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_20_1_1_4_openapi_yaml__validate @@ -1,8 +1,10 @@ -invalid components: schema "contributor-activity": invalid example: Error at "/0/w": value must be an integer +invalid components: schema "added-to-project-issue-event": invalid example: unhandled value of type time.Time Schema: { - "type": "integer" + "example": "2017-07-08T16:18:44-04:00", + "format": "date-time", + "type": "string" } Value: - "1367712000" + "2017-07-08T16:18:44-04:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_21_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_21_1_1_4_openapi_yaml__validate index 3dcff6d14..0a33c55eb 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_21_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_21_1_1_4_openapi_yaml__validate @@ -1,8 +1,10 @@ -invalid components: schema "contributor-activity": invalid example: Error at "/0/w": value must be an integer +invalid components: schema "added-to-project-issue-event": invalid example: unhandled value of type time.Time Schema: { - "type": "integer" + "example": "2017-07-08T16:18:44-04:00", + "format": "date-time", + "type": "string" } Value: - "1367712000" + "2017-07-08T16:18:44-04:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_22_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_22_1_1_4_openapi_yaml__validate index 3dcff6d14..fb3fa1a5d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_22_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_22_1_1_4_openapi_yaml__validate @@ -1,8 +1,9 @@ -invalid components: schema "contributor-activity": invalid example: Error at "/0/w": value must be an integer +invalid components: schema "actions-public-key": invalid example: unhandled value of type time.Time Schema: { - "type": "integer" + "example": "2011-01-26T19:01:12Z", + "type": "string" } Value: - "1367712000" + "2011-01-26T19:01:12Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_0_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_0_1_1_4_openapi_yaml__validate index ac78d6dd1..fb3fa1a5d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_0_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_0_1_1_4_openapi_yaml__validate @@ -1 +1,9 @@ -invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" +invalid components: schema "actions-public-key": invalid example: unhandled value of type time.Time +Schema: + { + "example": "2011-01-26T19:01:12Z", + "type": "string" + } + +Value: + "2011-01-26T19:01:12Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_1_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_1_1_1_4_openapi_yaml__validate index ac78d6dd1..fb3fa1a5d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_1_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_1_1_1_4_openapi_yaml__validate @@ -1 +1,9 @@ -invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" +invalid components: schema "actions-public-key": invalid example: unhandled value of type time.Time +Schema: + { + "example": "2011-01-26T19:01:12Z", + "type": "string" + } + +Value: + "2011-01-26T19:01:12Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_2_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_2_1_1_4_openapi_yaml__validate index ac78d6dd1..fb3fa1a5d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_2_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_2_1_1_4_openapi_yaml__validate @@ -1 +1,9 @@ -invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" +invalid components: schema "actions-public-key": invalid example: unhandled value of type time.Time +Schema: + { + "example": "2011-01-26T19:01:12Z", + "type": "string" + } + +Value: + "2011-01-26T19:01:12Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_3_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_3_1_1_4_openapi_yaml__validate index ac78d6dd1..fb3fa1a5d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_3_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_3_1_1_4_openapi_yaml__validate @@ -1 +1,9 @@ -invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" +invalid components: schema "actions-public-key": invalid example: unhandled value of type time.Time +Schema: + { + "example": "2011-01-26T19:01:12Z", + "type": "string" + } + +Value: + "2011-01-26T19:01:12Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_4_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_4_1_1_4_openapi_yaml__validate index ac78d6dd1..fb3fa1a5d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_4_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_4_1_1_4_openapi_yaml__validate @@ -1 +1,9 @@ -invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" +invalid components: schema "actions-public-key": invalid example: unhandled value of type time.Time +Schema: + { + "example": "2011-01-26T19:01:12Z", + "type": "string" + } + +Value: + "2011-01-26T19:01:12Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_5_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_5_1_1_4_openapi_yaml__validate index ac78d6dd1..fb3fa1a5d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_5_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_5_1_1_4_openapi_yaml__validate @@ -1 +1,9 @@ -invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" +invalid components: schema "actions-public-key": invalid example: unhandled value of type time.Time +Schema: + { + "example": "2011-01-26T19:01:12Z", + "type": "string" + } + +Value: + "2011-01-26T19:01:12Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_6_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_6_1_1_4_openapi_yaml__validate index ac78d6dd1..fb3fa1a5d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_6_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_6_1_1_4_openapi_yaml__validate @@ -1 +1,9 @@ -invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" +invalid components: schema "actions-public-key": invalid example: unhandled value of type time.Time +Schema: + { + "example": "2011-01-26T19:01:12Z", + "type": "string" + } + +Value: + "2011-01-26T19:01:12Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_7_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_7_1_1_4_openapi_yaml__validate index ac78d6dd1..b5cdccf09 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_7_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_7_1_1_4_openapi_yaml__validate @@ -1 +1,10 @@ -invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" +invalid components: schema "actions-cache-list": invalid example: unhandled value of type time.Time +Schema: + { + "example": "2019-01-24T22:45:36Z", + "format": "date-time", + "type": "string" + } + +Value: + "2019-01-24T22:45:36Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_8_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_8_1_1_4_openapi_yaml__validate index ac78d6dd1..b5cdccf09 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_8_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_8_1_1_4_openapi_yaml__validate @@ -1 +1,10 @@ -invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" +invalid components: schema "actions-cache-list": invalid example: unhandled value of type time.Time +Schema: + { + "example": "2019-01-24T22:45:36Z", + "format": "date-time", + "type": "string" + } + +Value: + "2019-01-24T22:45:36Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_github_ae_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_github_ae_1_1_4_openapi_yaml__validate index ac78d6dd1..fb3fa1a5d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_github_ae_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_github_ae_1_1_4_openapi_yaml__validate @@ -1 +1,9 @@ -invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" +invalid components: schema "actions-public-key": invalid example: unhandled value of type time.Time +Schema: + { + "example": "2011-01-26T19:01:12Z", + "type": "string" + } + +Value: + "2011-01-26T19:01:12Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_bcgnws_3_x_x_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_bcgnws_3_x_x_openapi_yaml__validate index d7feb2a18..3300cf5d0 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_bcgnws_3_x_x_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_bcgnws_3_x_x_openapi_yaml__validate @@ -1,8 +1,8 @@ -invalid paths: invalid path /names/changes: invalid operation GET: invalid example: value must be an integer +invalid paths: invalid path /names/changes: invalid operation GET: invalid example: unhandled value of type time.Time Schema: { "type": "integer" } Value: - "2017-01-01" + "2017-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/groundhog_day_com_1_2_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/groundhog_day_com_1_2_1_openapi_yaml__validate new file mode 100644 index 000000000..cee224041 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/groundhog_day_com_1_2_1_openapi_yaml__validate @@ -0,0 +1,8 @@ +invalid paths: invalid path /api/v1/groundhogs/{slug}: invalid operation GET: invalid example: example /groundhogs/punxsutawney-paul: Error at "/error/timestamp": unhandled value of type time.Time +Schema: + { + "type": "string" + } + +Value: + "2022-10-03T03:37:51.567Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/hetzner_cloud_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/hetzner_cloud_1_0_0_openapi_yaml__validate index 71c581016..357a05276 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/hetzner_cloud_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/hetzner_cloud_1_0_0_openapi_yaml__validate @@ -1,15 +1,11 @@ -invalid paths: invalid path /certificates: invalid operation GET: invalid example: value is not one of the allowed values ["pending","completed","failed"] +invalid paths: invalid path /actions: invalid operation GET: invalid example: unhandled value of type time.Time Schema: { - "description": "Status of the issuance process of the Certificate", - "enum": [ - "pending", - "completed", - "failed" - ], - "example": "valid", + "description": "Point in time when the Action was finished (in ISO-8601 format). Only set if the Action is finished otherwise null.", + "example": "2016-01-30T23:55:00Z", + "nullable": true, "type": "string" } Value: - "valid" + "2016-01-30T23:55:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/hubapi_com_communication_preferences_v3_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/hubapi_com_communication_preferences_v3_openapi_yaml__validate new file mode 100644 index 000000000..1d5a20e9e --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/hubapi_com_communication_preferences_v3_openapi_yaml__validate @@ -0,0 +1,60 @@ +invalid paths: invalid path /communication-preferences/v3/definitions: invalid operation GET: invalid example: Error at "/subscriptionDefinitions/0/createdAt": unhandled value of type time.Time +Schema: + { + "description": "Time at which the definition was created.", + "format": "date-time", + "type": "string" + } + +Value: + "2019-08-05T13:01:15.875Z" + | Error at "/subscriptionDefinitions/0/updatedAt": unhandled value of type time.Time +Schema: + { + "description": "Time at which the definition was last updated.", + "format": "date-time", + "type": "string" + } + +Value: + "2019-08-05T13:01:15.875Z" + | Error at "/subscriptionDefinitions/1/createdAt": unhandled value of type time.Time +Schema: + { + "description": "Time at which the definition was created.", + "format": "date-time", + "type": "string" + } + +Value: + "2019-08-05T13:01:15.875Z" + | Error at "/subscriptionDefinitions/1/updatedAt": unhandled value of type time.Time +Schema: + { + "description": "Time at which the definition was last updated.", + "format": "date-time", + "type": "string" + } + +Value: + "2019-08-05T13:01:15.875Z" + | Error at "/subscriptionDefinitions/2/createdAt": unhandled value of type time.Time +Schema: + { + "description": "Time at which the definition was created.", + "format": "date-time", + "type": "string" + } + +Value: + "2019-08-05T13:01:15.875Z" + | Error at "/subscriptionDefinitions/2/updatedAt": unhandled value of type time.Time +Schema: + { + "description": "Time at which the definition was last updated.", + "format": "date-time", + "type": "string" + } + +Value: + "2019-08-05T13:01:15.875Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/hubapi_com_webhooks_v3_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/hubapi_com_webhooks_v3_openapi_yaml__validate new file mode 100644 index 000000000..770ecc664 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/hubapi_com_webhooks_v3_openapi_yaml__validate @@ -0,0 +1,20 @@ +invalid components: schema "SettingsResponse": invalid example: Error at "/createdAt": unhandled value of type time.Time +Schema: + { + "description": "When this subscription was created. Formatted as milliseconds from the [Unix epoch](#).", + "format": "date-time", + "type": "string" + } + +Value: + "2020-01-24T16:27:59Z" + | Error at "/updatedAt": unhandled value of type time.Time +Schema: + { + "description": "When this subscription was last updated. Formatted as milliseconds from the [Unix epoch](#).", + "format": "date-time", + "type": "string" + } + +Value: + "2020-01-24T16:32:43Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/icons8_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/icons8_com_1_0_0_openapi_yaml__validate new file mode 100644 index 000000000..ba6c9064e --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/icons8_com_1_0_0_openapi_yaml__validate @@ -0,0 +1,8 @@ +invalid paths: invalid path /api/iconsets/v3/total?since={since}: invalid operation GET: invalid example: unhandled value of type time.Time +Schema: + { + "type": "string" + } + +Value: + "2014-12-31T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/ideal_postcodes_co_uk_3_7_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/ideal_postcodes_co_uk_3_7_0_openapi_yaml__validate index 627ac2d40..65fca1cb3 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/ideal_postcodes_co_uk_3_7_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/ideal_postcodes_co_uk_3_7_0_openapi_yaml__validate @@ -1,11 +1,11 @@ -invalid components: schema "EcadAddress": invalid allOf element: invalid example: value must be a string +invalid components: schema "ApiKeyCurrentPurchase": invalid example: unhandled value of type time.Time Schema: { - "description": "A number associated with the whole building. The building number may have a numeric and an alphanumeric component, which are concatenated e.g. 2A, or alternatively will have a simple building number or a complex building number. The building number always relates to the whole building and not a sub-unit within it.\nA complex building number may be one of the following:\n - Dual. Two number separated by '/' e.g. 63/64 = 63, 64\n - Sequence. An odd or even sequence of numbers with lower and upper bound separated by an underscore '_' e.g. `1_5` = 1,3,5 and `2_6` = 2,4,6 \n - Range. A range of consecutive numbers with lower and upper bound separated by a dash '-' e.g. `63-66` = 63, 64, 56, 66\nThe building number never appears on a line by itself and can prepend Building Group, Primary Thoroughfare or Primary Locality.", - "example": 22, - "maxLength": 40, + "description": "`string` or `null` The date when this purchase will expire in simplified \nextended ISO format (ISO 8601). This is typically 365 days from the time \nof first use. This field will be `null` if the purchase has not yet been \nused.", + "example": "2022-01-06T11:41:27.092Z", + "nullable": true, "type": "string" } Value: - 22 + "2022-01-06T11:41:27.092Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/impala_travel_hotels_1_003_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/impala_travel_hotels_1_003_openapi_yaml__validate new file mode 100644 index 000000000..9106bc381 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/impala_travel_hotels_1_003_openapi_yaml__validate @@ -0,0 +1,9 @@ +invalid components: schema "adjustmentConditionLengthOfStayRule": invalid example: unhandled value of type time.Time +Schema: + { + "example": "2021-08-23T00:00:00Z", + "type": "string" + } + +Value: + "2021-08-23T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/increase_com_0_0_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/increase_com_0_0_1_openapi_yaml__validate index 8ac5d0f2a..043027b0d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/increase_com_0_0_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/increase_com_0_0_1_openapi_yaml__validate @@ -1,4110 +1,21 @@ -invalid components: schema "declined_transaction": invalid example: Error at "/card_decline": property "card_decline" is missing +invalid components: schema "account": invalid example: Error at "/created_at": unhandled value of type time.Time Schema: { - "description": "This is an object giving more details on the network-level event that caused the Declined Transaction. For example, for a card transaction this lists the merchant's industry and location. Note that for backwards compatibility reasons, additional undocumented keys may appear in this object. These should be treated as deprecated and will be removed in the future.", - "example": { - "ach_decline": { - "amount": 1750, - "originator_company_descriptive_date": null, - "originator_company_discretionary_data": null, - "originator_company_id": "0987654321", - "originator_company_name": "BIG BANK", - "reason": "insufficient_funds", - "receiver_id_number": "12345678900", - "receiver_name": "IAN CREASE", - "trace_number": "021000038461022" - }, - "category": "ach_decline" - }, - "properties": { - "ach_decline": { - "description": "A ACH Decline object. This field will be present in the JSON response if and only if `category` is equal to `ach_decline`.", - "example": { - "amount": 1750, - "originator_company_descriptive_date": null, - "originator_company_discretionary_data": null, - "originator_company_id": "0987654321", - "originator_company_name": "BIG BANK", - "reason": "insufficient_funds", - "receiver_id_number": "12345678900", - "receiver_name": "IAN CREASE", - "trace_number": "021000038461022" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "originator_company_descriptive_date": { - "nullable": true, - "type": "string" - }, - "originator_company_discretionary_data": { - "nullable": true, - "type": "string" - }, - "originator_company_id": { - "type": "string" - }, - "originator_company_name": { - "type": "string" - }, - "reason": { - "description": "Why the ACH transfer was declined.", - "enum": [ - "ach_route_canceled", - "ach_route_disabled", - "breaches_limit", - "credit_entry_refused_by_receiver", - "duplicate_return", - "entity_not_active", - "group_locked", - "insufficient_funds", - "misrouted_return", - "no_ach_route", - "originator_request", - "transaction_not_allowed" - ], - "type": "string", - "x-enum-descriptions": [ - "The account number is canceled.", - "The account number is disabled.", - "The transaction would cause a limit to be exceeded.", - "A credit was refused.", - "Other.", - "The account's entity is not active.", - "Your account is inactive.", - "Your account contains insufficient funds.", - "Other.", - "The account number that was debited does not exist.", - "Other.", - "The transaction is not allowed per Increase's terms" - ] - }, - "receiver_id_number": { - "nullable": true, - "type": "string" - }, - "receiver_name": { - "nullable": true, - "type": "string" - }, - "trace_number": { - "type": "string" - } - }, - "required": [ - "amount", - "originator_company_name", - "originator_company_descriptive_date", - "originator_company_discretionary_data", - "originator_company_id", - "reason", - "receiver_id_number", - "receiver_name", - "trace_number" - ], - "title": "ACH Decline", - "type": "object", - "x-title-plural": "ACH Declines" - }, - "card_decline": { - "description": "A Card Decline object. This field will be present in the JSON response if and only if `category` is equal to `card_decline`.", - "example": { - "amount": -1000, - "currency": "USD", - "digital_wallet_token_id": null, - "merchant_acceptor_id": "372909060886", - "merchant_category_code": "5998", - "merchant_city": "5364086000", - "merchant_country": "USA", - "merchant_descriptor": "TENTS R US", - "merchant_state": "CA", - "network": "visa", - "network_details": { - "visa": { - "electronic_commerce_indicator": "secure_electronic_commerce", - "point_of_service_entry_mode": "manual" - } - }, - "real_time_decision_id": null, - "reason": "insufficient_funds" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "currency": { - "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination account currency.", - "enum": [ - "CAD", - "CHF", - "EUR", - "GBP", - "JPY", - "USD" - ], - "type": "string", - "x-enum-descriptions": [ - "Canadian Dollar (CAD)", - "Swiss Franc (CHF)", - "Euro (EUR)", - "British Pound (GBP)", - "Japanese Yen (JPY)", - "US Dollar (USD)" - ] - }, - "digital_wallet_token_id": { - "description": "If the authorization was attempted using a Digital Wallet Token (such as an Apple Pay purchase), the identifier of the token that was used.", - "nullable": true, - "type": "string" - }, - "merchant_acceptor_id": { - "description": "The merchant identifier (commonly abbreviated as MID) of the merchant the card is transacting with.", - "type": "string" - }, - "merchant_category_code": { - "description": "The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card is transacting with.", - "nullable": true, - "type": "string" - }, - "merchant_city": { - "description": "The city the merchant resides in.", - "nullable": true, - "type": "string" - }, - "merchant_country": { - "description": "The country the merchant resides in.", - "nullable": true, - "type": "string" - }, - "merchant_descriptor": { - "description": "The merchant descriptor of the merchant the card is transacting with.", - "type": "string" - }, - "merchant_state": { - "description": "The state the merchant resides in.", - "nullable": true, - "type": "string" - }, - "network": { - "description": "The payment network used to process this card authorization", - "enum": [ - "visa" - ], - "type": "string", - "x-enum-descriptions": [ - "Visa" - ] - }, - "network_details": { - "description": "Fields specific to the `network`", - "properties": { - "visa": { - "description": "Fields specific to the `visa` network", - "properties": { - "electronic_commerce_indicator": { - "description": "For electronic commerce transactions, this identifies the level of security used in obtaining the customer's payment credential. For mail or telephone order transactions, identifies the type of mail or telephone order.", - "enum": [ - "mail_phone_order", - "recurring", - "installment", - "unknown_mail_phone_order", - "secure_electronic_commerce", - "non_authenticated_security_transaction_at_3ds_capable_merchant", - "non_authenticated_security_transaction", - "non_secure_transaction" - ], - "nullable": true, - "type": "string", - "x-enum-descriptions": [ - "Single transaction of a mail/phone order: Use to indicate that the transaction is a mail/phone order purchase, not a recurring transaction or installment payment. For domestic transactions in the US region, this value may also indicate one bill payment transaction in the card-present or card-absent environments.", - "Recurring transaction: Payment indicator used to indicate a recurring transaction that originates from an acquirer in the US region.", - "Installment payment: Payment indicator used to indicate one purchase of goods or services that is billed to the account in multiple charges over a period of time agreed upon by the cardholder and merchant from transactions that originate from an acquirer in the US region.", - "Unknown classification: other mail order: Use to indicate that the type of mail/telephone order is unknown.", - "Secure electronic commerce transaction: Use to indicate that the electronic commerce transaction has been authenticated using e.g., 3-D Secure", - "Non-authenticated security transaction at a 3-D Secure-capable merchant, and merchant attempted to authenticate the cardholder using 3-D Secure: Use to identify an electronic commerce transaction where the merchant attempted to authenticate the cardholder using 3-D Secure, but was unable to complete the authentication because the issuer or cardholder does not participate in the 3-D Secure program.", - "Non-authenticated security transaction: Use to identify an electronic commerce transaction that uses data encryption for security however , cardholder authentication is not performed using 3-D Secure.", - "Non-secure transaction: Use to identify an electronic commerce transaction that has no data protection." - ] - }, - "point_of_service_entry_mode": { - "description": "The method used to enter the cardholder's primary account number and card expiration date", - "enum": [ - "manual", - "magnetic_stripe_no_cvv", - "optical_code", - "integrated_circuit_card", - "contactless", - "credential_on_file", - "magnetic_stripe", - "contactless_magnetic_stripe", - "integrated_circuit_card_no_cvv" - ], - "nullable": true, - "type": "string", - "x-enum-descriptions": [ - "Manual key entry", - "Magnetic stripe read, without card verification value", - "Optical code", - "Contact chip card", - "Contactless read of chip card", - "Transaction iniated using a credential that has previously been stored on file", - "Magnetic stripe read", - "Contactless read of magnetic stripe data", - "Contact chip card, without card verification value" - ] - } - }, - "required": [ - "electronic_commerce_indicator", - "point_of_service_entry_mode" - ], - "title": "Visa", - "type": "object", - "x-title-plural": "Visas" - } - }, - "required": [ - "visa" - ], - "title": "Network Details", - "type": "object", - "x-title-plural": "Network Detailss" - }, - "real_time_decision_id": { - "description": "The identifier of the Real-Time Decision sent to approve or decline this transaction.", - "nullable": true, - "type": "string" - }, - "reason": { - "description": "Why the transaction was declined.", - "enum": [ - "card_not_active", - "entity_not_active", - "group_locked", - "insufficient_funds", - "cvv2_mismatch", - "transaction_not_allowed", - "breaches_limit", - "webhook_declined", - "webhook_timed_out", - "declined_by_stand_in_processing", - "invalid_physical_card", - "missing_original_authorization" - ], - "type": "string", - "x-enum-descriptions": [ - "The Card was not active.", - "The account's entity was not active.", - "The account was inactive.", - "The Card's Account did not have a sufficient available balance.", - "The given CVV2 did not match the card's value.", - "The attempted card transaction is not allowed per Increase's terms.", - "The transaction was blocked by a Limit.", - "Your application declined the transaction via webhook.", - "Your application webhook did not respond without the required timeout.", - "Declined by stand-in processing.", - "The card read had an invalid CVV, dCVV, or authorization request cryptogram.", - "The original card authorization for this incremental authorization does not exist." - ] - } - }, - "required": [ - "merchant_acceptor_id", - "merchant_descriptor", - "merchant_category_code", - "merchant_city", - "merchant_country", - "network", - "network_details", - "amount", - "currency", - "reason", - "merchant_state", - "real_time_decision_id", - "digital_wallet_token_id" - ], - "title": "Card Decline", - "type": "object", - "x-title-plural": "Card Declines" - }, - "card_route_decline": { - "description": "A Deprecated Card Decline object. This field will be present in the JSON response if and only if `category` is equal to `card_route_decline`.", - "example": { - "amount": -1000, - "currency": "USD", - "merchant_acceptor_id": "372909060886", - "merchant_category_code": "5998", - "merchant_city": "5364086000", - "merchant_country": "USA", - "merchant_descriptor": "TENTS R US", - "merchant_state": "CA" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "currency": { - "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination account currency.", - "enum": [ - "CAD", - "CHF", - "EUR", - "GBP", - "JPY", - "USD" - ], - "type": "string", - "x-enum-descriptions": [ - "Canadian Dollar (CAD)", - "Swiss Franc (CHF)", - "Euro (EUR)", - "British Pound (GBP)", - "Japanese Yen (JPY)", - "US Dollar (USD)" - ] - }, - "merchant_acceptor_id": { - "type": "string" - }, - "merchant_category_code": { - "nullable": true, - "type": "string" - }, - "merchant_city": { - "nullable": true, - "type": "string" - }, - "merchant_country": { - "type": "string" - }, - "merchant_descriptor": { - "type": "string" - }, - "merchant_state": { - "nullable": true, - "type": "string" - } - }, - "required": [ - "amount", - "currency", - "merchant_acceptor_id", - "merchant_city", - "merchant_country", - "merchant_descriptor", - "merchant_state", - "merchant_category_code" - ], - "title": "Deprecated Card Decline", - "type": "object", - "x-title-plural": "Deprecated Card Declines" - }, - "category": { - "description": "The type of decline that took place. We may add additional possible values for this enum over time; your application should be able to handle such additions gracefully.", - "enum": [ - "ach_decline", - "card_decline", - "check_decline", - "inbound_real_time_payments_transfer_decline", - "international_ach_decline", - "card_route_decline", - "other" - ], - "type": "string", - "x-enum-descriptions": [ - "The Declined Transaction was created by a ACH Decline object. Details will be under the `ach_decline` object.", - "The Declined Transaction was created by a Card Decline object. Details will be under the `card_decline` object.", - "The Declined Transaction was created by a Check Decline object. Details will be under the `check_decline` object.", - "The Declined Transaction was created by a Inbound Real Time Payments Transfer Decline object. Details will be under the `inbound_real_time_payments_transfer_decline` object.", - "The Declined Transaction was created by a International ACH Decline object. Details will be under the `international_ach_decline` object.", - "The Declined Transaction was created by a Deprecated Card Decline object. Details will be under the `card_route_decline` object.", - "The Declined Transaction was made for an undocumented or deprecated reason." - ] - }, - "check_decline": { - "description": "A Check Decline object. This field will be present in the JSON response if and only if `category` is equal to `check_decline`.", - "example": { - "amount": -1000, - "auxiliary_on_us": "99999", - "reason": "insufficient_funds" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "auxiliary_on_us": { - "nullable": true, - "type": "string" - }, - "reason": { - "description": "Why the check was declined.", - "enum": [ - "ach_route_canceled", - "ach_route_disabled", - "breaches_limit", - "entity_not_active", - "group_locked", - "insufficient_funds", - "unable_to_locate_account", - "unable_to_process", - "refer_to_image", - "stop_payment_requested", - "returned", - "duplicate_presentment", - "not_authorized" - ], - "type": "string", - "x-enum-descriptions": [ - "The account number is canceled.", - "The account number is disabled.", - "The transaction would cause a limit to be exceeded.", - "The account's entity is not active.", - "Your account is inactive.", - "Your account contains insufficient funds.", - "Unable to locate account.", - "Unable to process.", - "Refer to image.", - "Stop payment requested for this check.", - "Check was returned to sender.", - "The check was a duplicate deposit.", - "The transaction is not allowed." - ] - } - }, - "required": [ - "amount", - "auxiliary_on_us", - "reason" - ], - "title": "Check Decline", - "type": "object", - "x-title-plural": "Check Declines" - }, - "inbound_real_time_payments_transfer_decline": { - "description": "A Inbound Real Time Payments Transfer Decline object. This field will be present in the JSON response if and only if `category` is equal to `inbound_real_time_payments_transfer_decline`.", - "example": { - "amount": 100, - "creditor_name": "Ian Crease", - "currency": "USD", - "debtor_account_number": "987654321", - "debtor_name": "National Phonograph Company", - "debtor_routing_number": "101050001", - "reason": "account_number_disabled", - "remittance_information": "Invoice 29582", - "transaction_identification": "20220501234567891T1BSLZO01745013025" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "creditor_name": { - "description": "The name the sender of the transfer specified as the recipient of the transfer.", - "type": "string" - }, - "currency": { - "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the declined transfer's currency. This will always be \"USD\" for a Real Time Payments transfer.", - "enum": [ - "CAD", - "CHF", - "EUR", - "GBP", - "JPY", - "USD" - ], - "type": "string", - "x-enum-descriptions": [ - "Canadian Dollar (CAD)", - "Swiss Franc (CHF)", - "Euro (EUR)", - "British Pound (GBP)", - "Japanese Yen (JPY)", - "US Dollar (USD)" - ] - }, - "debtor_account_number": { - "description": "The account number of the account that sent the transfer.", - "type": "string" - }, - "debtor_name": { - "description": "The name provided by the sender of the transfer.", - "type": "string" - }, - "debtor_routing_number": { - "description": "The routing number of the account that sent the transfer.", - "type": "string" - }, - "reason": { - "description": "Why the transfer was declined.", - "enum": [ - "account_number_canceled", - "account_number_disabled", - "group_locked", - "entity_not_active", - "real_time_payments_not_enabled" - ], - "type": "string", - "x-enum-descriptions": [ - "The account number is canceled.", - "The account number is disabled.", - "Your account is inactive.", - "The account's entity is not active.", - "Your account is not enabled to receive Real Time Payments transfers." - ] - }, - "remittance_information": { - "description": "Additional information included with the transfer.", - "nullable": true, - "type": "string" - }, - "transaction_identification": { - "description": "The Real Time Payments network identification of the declined transfer.", - "type": "string" - } - }, - "required": [ - "amount", - "currency", - "reason", - "creditor_name", - "debtor_name", - "debtor_account_number", - "debtor_routing_number", - "transaction_identification", - "remittance_information" - ], - "title": "Inbound Real Time Payments Transfer Decline", - "type": "object", - "x-title-plural": "Inbound Real Time Payments Transfer Declines" - }, - "international_ach_decline": { - "description": "A International ACH Decline object. This field will be present in the JSON response if and only if `category` is equal to `international_ach_decline`.", - "example": { - "amount": -1000, - "destination_country_code": "US", - "destination_currency_code": "USD", - "foreign_exchange_indicator": "fixed_to_fixed", - "foreign_exchange_reference": null, - "foreign_exchange_reference_indicator": "blank", - "foreign_payment_amount": 199, - "foreign_trace_number": null, - "international_transaction_type_code": "internet_initiated", - "originating_currency_code": "USD", - "originating_depository_financial_institution_branch_country": "US", - "originating_depository_financial_institution_id": "091000019", - "originating_depository_financial_institution_id_qualifier": "national_clearing_system_number", - "originating_depository_financial_institution_name": "WELLS FARGO BANK", - "originator_city": "BERLIN", - "originator_company_entry_description": "RETRY PYMT", - "originator_country": "DE", - "originator_identification": "770510487A", - "originator_name": "BERGHAIN", - "originator_postal_code": "50825", - "originator_state_or_province": null, - "originator_street_address": "Ruedersdorferstr. 7", - "payment_related_information": null, - "payment_related_information2": null, - "receiver_city": "BEVERLY HILLS", - "receiver_country": "US", - "receiver_identification_number": "1018790279274", - "receiver_postal_code": "90210", - "receiver_state_or_province": "CA", - "receiver_street_address": "123 FAKE ST", - "receiving_company_or_individual_name": "IAN CREASE", - "receiving_depository_financial_institution_country": "US", - "receiving_depository_financial_institution_id": "101050001", - "receiving_depository_financial_institution_id_qualifier": "national_clearing_system_number", - "receiving_depository_financial_institution_name": "BLUE RIDGE BANK, NATIONAL ASSOCIATI", - "trace_number": "010202909100090" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "destination_country_code": { - "type": "string" - }, - "destination_currency_code": { - "type": "string" - }, - "foreign_exchange_indicator": { - "type": "string" - }, - "foreign_exchange_reference": { - "nullable": true, - "type": "string" - }, - "foreign_exchange_reference_indicator": { - "type": "string" - }, - "foreign_payment_amount": { - "type": "integer" - }, - "foreign_trace_number": { - "nullable": true, - "type": "string" - }, - "international_transaction_type_code": { - "type": "string" - }, - "originating_currency_code": { - "type": "string" - }, - "originating_depository_financial_institution_branch_country": { - "type": "string" - }, - "originating_depository_financial_institution_id": { - "type": "string" - }, - "originating_depository_financial_institution_id_qualifier": { - "type": "string" - }, - "originating_depository_financial_institution_name": { - "type": "string" - }, - "originator_city": { - "type": "string" - }, - "originator_company_entry_description": { - "type": "string" - }, - "originator_country": { - "type": "string" - }, - "originator_identification": { - "type": "string" - }, - "originator_name": { - "type": "string" - }, - "originator_postal_code": { - "nullable": true, - "type": "string" - }, - "originator_state_or_province": { - "nullable": true, - "type": "string" - }, - "originator_street_address": { - "type": "string" - }, - "payment_related_information": { - "nullable": true, - "type": "string" - }, - "payment_related_information2": { - "nullable": true, - "type": "string" - }, - "receiver_city": { - "type": "string" - }, - "receiver_country": { - "type": "string" - }, - "receiver_identification_number": { - "nullable": true, - "type": "string" - }, - "receiver_postal_code": { - "nullable": true, - "type": "string" - }, - "receiver_state_or_province": { - "nullable": true, - "type": "string" - }, - "receiver_street_address": { - "type": "string" - }, - "receiving_company_or_individual_name": { - "type": "string" - }, - "receiving_depository_financial_institution_country": { - "type": "string" - }, - "receiving_depository_financial_institution_id": { - "type": "string" - }, - "receiving_depository_financial_institution_id_qualifier": { - "type": "string" - }, - "receiving_depository_financial_institution_name": { - "type": "string" - }, - "trace_number": { - "type": "string" - } - }, - "required": [ - "amount", - "foreign_exchange_indicator", - "foreign_exchange_reference_indicator", - "foreign_exchange_reference", - "destination_country_code", - "destination_currency_code", - "foreign_payment_amount", - "foreign_trace_number", - "international_transaction_type_code", - "originating_currency_code", - "originating_depository_financial_institution_name", - "originating_depository_financial_institution_id_qualifier", - "originating_depository_financial_institution_id", - "originating_depository_financial_institution_branch_country", - "originator_city", - "originator_company_entry_description", - "originator_country", - "originator_identification", - "originator_name", - "originator_postal_code", - "originator_street_address", - "originator_state_or_province", - "payment_related_information", - "payment_related_information2", - "receiver_identification_number", - "receiver_street_address", - "receiver_city", - "receiver_state_or_province", - "receiver_country", - "receiver_postal_code", - "receiving_company_or_individual_name", - "receiving_depository_financial_institution_name", - "receiving_depository_financial_institution_id_qualifier", - "receiving_depository_financial_institution_id", - "receiving_depository_financial_institution_country", - "trace_number" - ], - "title": "International ACH Decline", - "type": "object", - "x-title-plural": "International ACH Declines" - } - }, - "required": [ - "category", - "ach_decline", - "card_decline", - "check_decline", - "inbound_real_time_payments_transfer_decline", - "international_ach_decline", - "card_route_decline" - ], - "title": "Declined Transaction Source", - "type": "object", - "x-title-plural": "Declined Transaction Sources" + "description": "The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Account was created.", + "format": "date-time", + "type": "string" } Value: - { - "ach_decline": { - "amount": 1750, - "originator_company_descriptive_date": null, - "originator_company_discretionary_data": null, - "originator_company_id": "0987654321", - "originator_company_name": "BIG BANK", - "reason": "insufficient_funds", - "receiver_id_number": "12345678900", - "receiver_name": "IAN CREASE", - "trace_number": "021000038461022" - }, - "category": "ach_decline" - } - | Error at "/check_decline": property "check_decline" is missing + "2020-01-31T23:59:59Z" + | Error at "/interest_accrued_at": unhandled value of type time.Time Schema: { - "description": "This is an object giving more details on the network-level event that caused the Declined Transaction. For example, for a card transaction this lists the merchant's industry and location. Note that for backwards compatibility reasons, additional undocumented keys may appear in this object. These should be treated as deprecated and will be removed in the future.", - "example": { - "ach_decline": { - "amount": 1750, - "originator_company_descriptive_date": null, - "originator_company_discretionary_data": null, - "originator_company_id": "0987654321", - "originator_company_name": "BIG BANK", - "reason": "insufficient_funds", - "receiver_id_number": "12345678900", - "receiver_name": "IAN CREASE", - "trace_number": "021000038461022" - }, - "category": "ach_decline" - }, - "properties": { - "ach_decline": { - "description": "A ACH Decline object. This field will be present in the JSON response if and only if `category` is equal to `ach_decline`.", - "example": { - "amount": 1750, - "originator_company_descriptive_date": null, - "originator_company_discretionary_data": null, - "originator_company_id": "0987654321", - "originator_company_name": "BIG BANK", - "reason": "insufficient_funds", - "receiver_id_number": "12345678900", - "receiver_name": "IAN CREASE", - "trace_number": "021000038461022" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "originator_company_descriptive_date": { - "nullable": true, - "type": "string" - }, - "originator_company_discretionary_data": { - "nullable": true, - "type": "string" - }, - "originator_company_id": { - "type": "string" - }, - "originator_company_name": { - "type": "string" - }, - "reason": { - "description": "Why the ACH transfer was declined.", - "enum": [ - "ach_route_canceled", - "ach_route_disabled", - "breaches_limit", - "credit_entry_refused_by_receiver", - "duplicate_return", - "entity_not_active", - "group_locked", - "insufficient_funds", - "misrouted_return", - "no_ach_route", - "originator_request", - "transaction_not_allowed" - ], - "type": "string", - "x-enum-descriptions": [ - "The account number is canceled.", - "The account number is disabled.", - "The transaction would cause a limit to be exceeded.", - "A credit was refused.", - "Other.", - "The account's entity is not active.", - "Your account is inactive.", - "Your account contains insufficient funds.", - "Other.", - "The account number that was debited does not exist.", - "Other.", - "The transaction is not allowed per Increase's terms" - ] - }, - "receiver_id_number": { - "nullable": true, - "type": "string" - }, - "receiver_name": { - "nullable": true, - "type": "string" - }, - "trace_number": { - "type": "string" - } - }, - "required": [ - "amount", - "originator_company_name", - "originator_company_descriptive_date", - "originator_company_discretionary_data", - "originator_company_id", - "reason", - "receiver_id_number", - "receiver_name", - "trace_number" - ], - "title": "ACH Decline", - "type": "object", - "x-title-plural": "ACH Declines" - }, - "card_decline": { - "description": "A Card Decline object. This field will be present in the JSON response if and only if `category` is equal to `card_decline`.", - "example": { - "amount": -1000, - "currency": "USD", - "digital_wallet_token_id": null, - "merchant_acceptor_id": "372909060886", - "merchant_category_code": "5998", - "merchant_city": "5364086000", - "merchant_country": "USA", - "merchant_descriptor": "TENTS R US", - "merchant_state": "CA", - "network": "visa", - "network_details": { - "visa": { - "electronic_commerce_indicator": "secure_electronic_commerce", - "point_of_service_entry_mode": "manual" - } - }, - "real_time_decision_id": null, - "reason": "insufficient_funds" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "currency": { - "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination account currency.", - "enum": [ - "CAD", - "CHF", - "EUR", - "GBP", - "JPY", - "USD" - ], - "type": "string", - "x-enum-descriptions": [ - "Canadian Dollar (CAD)", - "Swiss Franc (CHF)", - "Euro (EUR)", - "British Pound (GBP)", - "Japanese Yen (JPY)", - "US Dollar (USD)" - ] - }, - "digital_wallet_token_id": { - "description": "If the authorization was attempted using a Digital Wallet Token (such as an Apple Pay purchase), the identifier of the token that was used.", - "nullable": true, - "type": "string" - }, - "merchant_acceptor_id": { - "description": "The merchant identifier (commonly abbreviated as MID) of the merchant the card is transacting with.", - "type": "string" - }, - "merchant_category_code": { - "description": "The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card is transacting with.", - "nullable": true, - "type": "string" - }, - "merchant_city": { - "description": "The city the merchant resides in.", - "nullable": true, - "type": "string" - }, - "merchant_country": { - "description": "The country the merchant resides in.", - "nullable": true, - "type": "string" - }, - "merchant_descriptor": { - "description": "The merchant descriptor of the merchant the card is transacting with.", - "type": "string" - }, - "merchant_state": { - "description": "The state the merchant resides in.", - "nullable": true, - "type": "string" - }, - "network": { - "description": "The payment network used to process this card authorization", - "enum": [ - "visa" - ], - "type": "string", - "x-enum-descriptions": [ - "Visa" - ] - }, - "network_details": { - "description": "Fields specific to the `network`", - "properties": { - "visa": { - "description": "Fields specific to the `visa` network", - "properties": { - "electronic_commerce_indicator": { - "description": "For electronic commerce transactions, this identifies the level of security used in obtaining the customer's payment credential. For mail or telephone order transactions, identifies the type of mail or telephone order.", - "enum": [ - "mail_phone_order", - "recurring", - "installment", - "unknown_mail_phone_order", - "secure_electronic_commerce", - "non_authenticated_security_transaction_at_3ds_capable_merchant", - "non_authenticated_security_transaction", - "non_secure_transaction" - ], - "nullable": true, - "type": "string", - "x-enum-descriptions": [ - "Single transaction of a mail/phone order: Use to indicate that the transaction is a mail/phone order purchase, not a recurring transaction or installment payment. For domestic transactions in the US region, this value may also indicate one bill payment transaction in the card-present or card-absent environments.", - "Recurring transaction: Payment indicator used to indicate a recurring transaction that originates from an acquirer in the US region.", - "Installment payment: Payment indicator used to indicate one purchase of goods or services that is billed to the account in multiple charges over a period of time agreed upon by the cardholder and merchant from transactions that originate from an acquirer in the US region.", - "Unknown classification: other mail order: Use to indicate that the type of mail/telephone order is unknown.", - "Secure electronic commerce transaction: Use to indicate that the electronic commerce transaction has been authenticated using e.g., 3-D Secure", - "Non-authenticated security transaction at a 3-D Secure-capable merchant, and merchant attempted to authenticate the cardholder using 3-D Secure: Use to identify an electronic commerce transaction where the merchant attempted to authenticate the cardholder using 3-D Secure, but was unable to complete the authentication because the issuer or cardholder does not participate in the 3-D Secure program.", - "Non-authenticated security transaction: Use to identify an electronic commerce transaction that uses data encryption for security however , cardholder authentication is not performed using 3-D Secure.", - "Non-secure transaction: Use to identify an electronic commerce transaction that has no data protection." - ] - }, - "point_of_service_entry_mode": { - "description": "The method used to enter the cardholder's primary account number and card expiration date", - "enum": [ - "manual", - "magnetic_stripe_no_cvv", - "optical_code", - "integrated_circuit_card", - "contactless", - "credential_on_file", - "magnetic_stripe", - "contactless_magnetic_stripe", - "integrated_circuit_card_no_cvv" - ], - "nullable": true, - "type": "string", - "x-enum-descriptions": [ - "Manual key entry", - "Magnetic stripe read, without card verification value", - "Optical code", - "Contact chip card", - "Contactless read of chip card", - "Transaction iniated using a credential that has previously been stored on file", - "Magnetic stripe read", - "Contactless read of magnetic stripe data", - "Contact chip card, without card verification value" - ] - } - }, - "required": [ - "electronic_commerce_indicator", - "point_of_service_entry_mode" - ], - "title": "Visa", - "type": "object", - "x-title-plural": "Visas" - } - }, - "required": [ - "visa" - ], - "title": "Network Details", - "type": "object", - "x-title-plural": "Network Detailss" - }, - "real_time_decision_id": { - "description": "The identifier of the Real-Time Decision sent to approve or decline this transaction.", - "nullable": true, - "type": "string" - }, - "reason": { - "description": "Why the transaction was declined.", - "enum": [ - "card_not_active", - "entity_not_active", - "group_locked", - "insufficient_funds", - "cvv2_mismatch", - "transaction_not_allowed", - "breaches_limit", - "webhook_declined", - "webhook_timed_out", - "declined_by_stand_in_processing", - "invalid_physical_card", - "missing_original_authorization" - ], - "type": "string", - "x-enum-descriptions": [ - "The Card was not active.", - "The account's entity was not active.", - "The account was inactive.", - "The Card's Account did not have a sufficient available balance.", - "The given CVV2 did not match the card's value.", - "The attempted card transaction is not allowed per Increase's terms.", - "The transaction was blocked by a Limit.", - "Your application declined the transaction via webhook.", - "Your application webhook did not respond without the required timeout.", - "Declined by stand-in processing.", - "The card read had an invalid CVV, dCVV, or authorization request cryptogram.", - "The original card authorization for this incremental authorization does not exist." - ] - } - }, - "required": [ - "merchant_acceptor_id", - "merchant_descriptor", - "merchant_category_code", - "merchant_city", - "merchant_country", - "network", - "network_details", - "amount", - "currency", - "reason", - "merchant_state", - "real_time_decision_id", - "digital_wallet_token_id" - ], - "title": "Card Decline", - "type": "object", - "x-title-plural": "Card Declines" - }, - "card_route_decline": { - "description": "A Deprecated Card Decline object. This field will be present in the JSON response if and only if `category` is equal to `card_route_decline`.", - "example": { - "amount": -1000, - "currency": "USD", - "merchant_acceptor_id": "372909060886", - "merchant_category_code": "5998", - "merchant_city": "5364086000", - "merchant_country": "USA", - "merchant_descriptor": "TENTS R US", - "merchant_state": "CA" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "currency": { - "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination account currency.", - "enum": [ - "CAD", - "CHF", - "EUR", - "GBP", - "JPY", - "USD" - ], - "type": "string", - "x-enum-descriptions": [ - "Canadian Dollar (CAD)", - "Swiss Franc (CHF)", - "Euro (EUR)", - "British Pound (GBP)", - "Japanese Yen (JPY)", - "US Dollar (USD)" - ] - }, - "merchant_acceptor_id": { - "type": "string" - }, - "merchant_category_code": { - "nullable": true, - "type": "string" - }, - "merchant_city": { - "nullable": true, - "type": "string" - }, - "merchant_country": { - "type": "string" - }, - "merchant_descriptor": { - "type": "string" - }, - "merchant_state": { - "nullable": true, - "type": "string" - } - }, - "required": [ - "amount", - "currency", - "merchant_acceptor_id", - "merchant_city", - "merchant_country", - "merchant_descriptor", - "merchant_state", - "merchant_category_code" - ], - "title": "Deprecated Card Decline", - "type": "object", - "x-title-plural": "Deprecated Card Declines" - }, - "category": { - "description": "The type of decline that took place. We may add additional possible values for this enum over time; your application should be able to handle such additions gracefully.", - "enum": [ - "ach_decline", - "card_decline", - "check_decline", - "inbound_real_time_payments_transfer_decline", - "international_ach_decline", - "card_route_decline", - "other" - ], - "type": "string", - "x-enum-descriptions": [ - "The Declined Transaction was created by a ACH Decline object. Details will be under the `ach_decline` object.", - "The Declined Transaction was created by a Card Decline object. Details will be under the `card_decline` object.", - "The Declined Transaction was created by a Check Decline object. Details will be under the `check_decline` object.", - "The Declined Transaction was created by a Inbound Real Time Payments Transfer Decline object. Details will be under the `inbound_real_time_payments_transfer_decline` object.", - "The Declined Transaction was created by a International ACH Decline object. Details will be under the `international_ach_decline` object.", - "The Declined Transaction was created by a Deprecated Card Decline object. Details will be under the `card_route_decline` object.", - "The Declined Transaction was made for an undocumented or deprecated reason." - ] - }, - "check_decline": { - "description": "A Check Decline object. This field will be present in the JSON response if and only if `category` is equal to `check_decline`.", - "example": { - "amount": -1000, - "auxiliary_on_us": "99999", - "reason": "insufficient_funds" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "auxiliary_on_us": { - "nullable": true, - "type": "string" - }, - "reason": { - "description": "Why the check was declined.", - "enum": [ - "ach_route_canceled", - "ach_route_disabled", - "breaches_limit", - "entity_not_active", - "group_locked", - "insufficient_funds", - "unable_to_locate_account", - "unable_to_process", - "refer_to_image", - "stop_payment_requested", - "returned", - "duplicate_presentment", - "not_authorized" - ], - "type": "string", - "x-enum-descriptions": [ - "The account number is canceled.", - "The account number is disabled.", - "The transaction would cause a limit to be exceeded.", - "The account's entity is not active.", - "Your account is inactive.", - "Your account contains insufficient funds.", - "Unable to locate account.", - "Unable to process.", - "Refer to image.", - "Stop payment requested for this check.", - "Check was returned to sender.", - "The check was a duplicate deposit.", - "The transaction is not allowed." - ] - } - }, - "required": [ - "amount", - "auxiliary_on_us", - "reason" - ], - "title": "Check Decline", - "type": "object", - "x-title-plural": "Check Declines" - }, - "inbound_real_time_payments_transfer_decline": { - "description": "A Inbound Real Time Payments Transfer Decline object. This field will be present in the JSON response if and only if `category` is equal to `inbound_real_time_payments_transfer_decline`.", - "example": { - "amount": 100, - "creditor_name": "Ian Crease", - "currency": "USD", - "debtor_account_number": "987654321", - "debtor_name": "National Phonograph Company", - "debtor_routing_number": "101050001", - "reason": "account_number_disabled", - "remittance_information": "Invoice 29582", - "transaction_identification": "20220501234567891T1BSLZO01745013025" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "creditor_name": { - "description": "The name the sender of the transfer specified as the recipient of the transfer.", - "type": "string" - }, - "currency": { - "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the declined transfer's currency. This will always be \"USD\" for a Real Time Payments transfer.", - "enum": [ - "CAD", - "CHF", - "EUR", - "GBP", - "JPY", - "USD" - ], - "type": "string", - "x-enum-descriptions": [ - "Canadian Dollar (CAD)", - "Swiss Franc (CHF)", - "Euro (EUR)", - "British Pound (GBP)", - "Japanese Yen (JPY)", - "US Dollar (USD)" - ] - }, - "debtor_account_number": { - "description": "The account number of the account that sent the transfer.", - "type": "string" - }, - "debtor_name": { - "description": "The name provided by the sender of the transfer.", - "type": "string" - }, - "debtor_routing_number": { - "description": "The routing number of the account that sent the transfer.", - "type": "string" - }, - "reason": { - "description": "Why the transfer was declined.", - "enum": [ - "account_number_canceled", - "account_number_disabled", - "group_locked", - "entity_not_active", - "real_time_payments_not_enabled" - ], - "type": "string", - "x-enum-descriptions": [ - "The account number is canceled.", - "The account number is disabled.", - "Your account is inactive.", - "The account's entity is not active.", - "Your account is not enabled to receive Real Time Payments transfers." - ] - }, - "remittance_information": { - "description": "Additional information included with the transfer.", - "nullable": true, - "type": "string" - }, - "transaction_identification": { - "description": "The Real Time Payments network identification of the declined transfer.", - "type": "string" - } - }, - "required": [ - "amount", - "currency", - "reason", - "creditor_name", - "debtor_name", - "debtor_account_number", - "debtor_routing_number", - "transaction_identification", - "remittance_information" - ], - "title": "Inbound Real Time Payments Transfer Decline", - "type": "object", - "x-title-plural": "Inbound Real Time Payments Transfer Declines" - }, - "international_ach_decline": { - "description": "A International ACH Decline object. This field will be present in the JSON response if and only if `category` is equal to `international_ach_decline`.", - "example": { - "amount": -1000, - "destination_country_code": "US", - "destination_currency_code": "USD", - "foreign_exchange_indicator": "fixed_to_fixed", - "foreign_exchange_reference": null, - "foreign_exchange_reference_indicator": "blank", - "foreign_payment_amount": 199, - "foreign_trace_number": null, - "international_transaction_type_code": "internet_initiated", - "originating_currency_code": "USD", - "originating_depository_financial_institution_branch_country": "US", - "originating_depository_financial_institution_id": "091000019", - "originating_depository_financial_institution_id_qualifier": "national_clearing_system_number", - "originating_depository_financial_institution_name": "WELLS FARGO BANK", - "originator_city": "BERLIN", - "originator_company_entry_description": "RETRY PYMT", - "originator_country": "DE", - "originator_identification": "770510487A", - "originator_name": "BERGHAIN", - "originator_postal_code": "50825", - "originator_state_or_province": null, - "originator_street_address": "Ruedersdorferstr. 7", - "payment_related_information": null, - "payment_related_information2": null, - "receiver_city": "BEVERLY HILLS", - "receiver_country": "US", - "receiver_identification_number": "1018790279274", - "receiver_postal_code": "90210", - "receiver_state_or_province": "CA", - "receiver_street_address": "123 FAKE ST", - "receiving_company_or_individual_name": "IAN CREASE", - "receiving_depository_financial_institution_country": "US", - "receiving_depository_financial_institution_id": "101050001", - "receiving_depository_financial_institution_id_qualifier": "national_clearing_system_number", - "receiving_depository_financial_institution_name": "BLUE RIDGE BANK, NATIONAL ASSOCIATI", - "trace_number": "010202909100090" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "destination_country_code": { - "type": "string" - }, - "destination_currency_code": { - "type": "string" - }, - "foreign_exchange_indicator": { - "type": "string" - }, - "foreign_exchange_reference": { - "nullable": true, - "type": "string" - }, - "foreign_exchange_reference_indicator": { - "type": "string" - }, - "foreign_payment_amount": { - "type": "integer" - }, - "foreign_trace_number": { - "nullable": true, - "type": "string" - }, - "international_transaction_type_code": { - "type": "string" - }, - "originating_currency_code": { - "type": "string" - }, - "originating_depository_financial_institution_branch_country": { - "type": "string" - }, - "originating_depository_financial_institution_id": { - "type": "string" - }, - "originating_depository_financial_institution_id_qualifier": { - "type": "string" - }, - "originating_depository_financial_institution_name": { - "type": "string" - }, - "originator_city": { - "type": "string" - }, - "originator_company_entry_description": { - "type": "string" - }, - "originator_country": { - "type": "string" - }, - "originator_identification": { - "type": "string" - }, - "originator_name": { - "type": "string" - }, - "originator_postal_code": { - "nullable": true, - "type": "string" - }, - "originator_state_or_province": { - "nullable": true, - "type": "string" - }, - "originator_street_address": { - "type": "string" - }, - "payment_related_information": { - "nullable": true, - "type": "string" - }, - "payment_related_information2": { - "nullable": true, - "type": "string" - }, - "receiver_city": { - "type": "string" - }, - "receiver_country": { - "type": "string" - }, - "receiver_identification_number": { - "nullable": true, - "type": "string" - }, - "receiver_postal_code": { - "nullable": true, - "type": "string" - }, - "receiver_state_or_province": { - "nullable": true, - "type": "string" - }, - "receiver_street_address": { - "type": "string" - }, - "receiving_company_or_individual_name": { - "type": "string" - }, - "receiving_depository_financial_institution_country": { - "type": "string" - }, - "receiving_depository_financial_institution_id": { - "type": "string" - }, - "receiving_depository_financial_institution_id_qualifier": { - "type": "string" - }, - "receiving_depository_financial_institution_name": { - "type": "string" - }, - "trace_number": { - "type": "string" - } - }, - "required": [ - "amount", - "foreign_exchange_indicator", - "foreign_exchange_reference_indicator", - "foreign_exchange_reference", - "destination_country_code", - "destination_currency_code", - "foreign_payment_amount", - "foreign_trace_number", - "international_transaction_type_code", - "originating_currency_code", - "originating_depository_financial_institution_name", - "originating_depository_financial_institution_id_qualifier", - "originating_depository_financial_institution_id", - "originating_depository_financial_institution_branch_country", - "originator_city", - "originator_company_entry_description", - "originator_country", - "originator_identification", - "originator_name", - "originator_postal_code", - "originator_street_address", - "originator_state_or_province", - "payment_related_information", - "payment_related_information2", - "receiver_identification_number", - "receiver_street_address", - "receiver_city", - "receiver_state_or_province", - "receiver_country", - "receiver_postal_code", - "receiving_company_or_individual_name", - "receiving_depository_financial_institution_name", - "receiving_depository_financial_institution_id_qualifier", - "receiving_depository_financial_institution_id", - "receiving_depository_financial_institution_country", - "trace_number" - ], - "title": "International ACH Decline", - "type": "object", - "x-title-plural": "International ACH Declines" - } - }, - "required": [ - "category", - "ach_decline", - "card_decline", - "check_decline", - "inbound_real_time_payments_transfer_decline", - "international_ach_decline", - "card_route_decline" - ], - "title": "Declined Transaction Source", - "type": "object", - "x-title-plural": "Declined Transaction Sources" + "description": "The latest [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which interest was accrued.", + "format": "date", + "nullable": true, + "type": "string" } Value: - { - "ach_decline": { - "amount": 1750, - "originator_company_descriptive_date": null, - "originator_company_discretionary_data": null, - "originator_company_id": "0987654321", - "originator_company_name": "BIG BANK", - "reason": "insufficient_funds", - "receiver_id_number": "12345678900", - "receiver_name": "IAN CREASE", - "trace_number": "021000038461022" - }, - "category": "ach_decline" - } - | Error at "/inbound_real_time_payments_transfer_decline": property "inbound_real_time_payments_transfer_decline" is missing -Schema: - { - "description": "This is an object giving more details on the network-level event that caused the Declined Transaction. For example, for a card transaction this lists the merchant's industry and location. Note that for backwards compatibility reasons, additional undocumented keys may appear in this object. These should be treated as deprecated and will be removed in the future.", - "example": { - "ach_decline": { - "amount": 1750, - "originator_company_descriptive_date": null, - "originator_company_discretionary_data": null, - "originator_company_id": "0987654321", - "originator_company_name": "BIG BANK", - "reason": "insufficient_funds", - "receiver_id_number": "12345678900", - "receiver_name": "IAN CREASE", - "trace_number": "021000038461022" - }, - "category": "ach_decline" - }, - "properties": { - "ach_decline": { - "description": "A ACH Decline object. This field will be present in the JSON response if and only if `category` is equal to `ach_decline`.", - "example": { - "amount": 1750, - "originator_company_descriptive_date": null, - "originator_company_discretionary_data": null, - "originator_company_id": "0987654321", - "originator_company_name": "BIG BANK", - "reason": "insufficient_funds", - "receiver_id_number": "12345678900", - "receiver_name": "IAN CREASE", - "trace_number": "021000038461022" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "originator_company_descriptive_date": { - "nullable": true, - "type": "string" - }, - "originator_company_discretionary_data": { - "nullable": true, - "type": "string" - }, - "originator_company_id": { - "type": "string" - }, - "originator_company_name": { - "type": "string" - }, - "reason": { - "description": "Why the ACH transfer was declined.", - "enum": [ - "ach_route_canceled", - "ach_route_disabled", - "breaches_limit", - "credit_entry_refused_by_receiver", - "duplicate_return", - "entity_not_active", - "group_locked", - "insufficient_funds", - "misrouted_return", - "no_ach_route", - "originator_request", - "transaction_not_allowed" - ], - "type": "string", - "x-enum-descriptions": [ - "The account number is canceled.", - "The account number is disabled.", - "The transaction would cause a limit to be exceeded.", - "A credit was refused.", - "Other.", - "The account's entity is not active.", - "Your account is inactive.", - "Your account contains insufficient funds.", - "Other.", - "The account number that was debited does not exist.", - "Other.", - "The transaction is not allowed per Increase's terms" - ] - }, - "receiver_id_number": { - "nullable": true, - "type": "string" - }, - "receiver_name": { - "nullable": true, - "type": "string" - }, - "trace_number": { - "type": "string" - } - }, - "required": [ - "amount", - "originator_company_name", - "originator_company_descriptive_date", - "originator_company_discretionary_data", - "originator_company_id", - "reason", - "receiver_id_number", - "receiver_name", - "trace_number" - ], - "title": "ACH Decline", - "type": "object", - "x-title-plural": "ACH Declines" - }, - "card_decline": { - "description": "A Card Decline object. This field will be present in the JSON response if and only if `category` is equal to `card_decline`.", - "example": { - "amount": -1000, - "currency": "USD", - "digital_wallet_token_id": null, - "merchant_acceptor_id": "372909060886", - "merchant_category_code": "5998", - "merchant_city": "5364086000", - "merchant_country": "USA", - "merchant_descriptor": "TENTS R US", - "merchant_state": "CA", - "network": "visa", - "network_details": { - "visa": { - "electronic_commerce_indicator": "secure_electronic_commerce", - "point_of_service_entry_mode": "manual" - } - }, - "real_time_decision_id": null, - "reason": "insufficient_funds" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "currency": { - "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination account currency.", - "enum": [ - "CAD", - "CHF", - "EUR", - "GBP", - "JPY", - "USD" - ], - "type": "string", - "x-enum-descriptions": [ - "Canadian Dollar (CAD)", - "Swiss Franc (CHF)", - "Euro (EUR)", - "British Pound (GBP)", - "Japanese Yen (JPY)", - "US Dollar (USD)" - ] - }, - "digital_wallet_token_id": { - "description": "If the authorization was attempted using a Digital Wallet Token (such as an Apple Pay purchase), the identifier of the token that was used.", - "nullable": true, - "type": "string" - }, - "merchant_acceptor_id": { - "description": "The merchant identifier (commonly abbreviated as MID) of the merchant the card is transacting with.", - "type": "string" - }, - "merchant_category_code": { - "description": "The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card is transacting with.", - "nullable": true, - "type": "string" - }, - "merchant_city": { - "description": "The city the merchant resides in.", - "nullable": true, - "type": "string" - }, - "merchant_country": { - "description": "The country the merchant resides in.", - "nullable": true, - "type": "string" - }, - "merchant_descriptor": { - "description": "The merchant descriptor of the merchant the card is transacting with.", - "type": "string" - }, - "merchant_state": { - "description": "The state the merchant resides in.", - "nullable": true, - "type": "string" - }, - "network": { - "description": "The payment network used to process this card authorization", - "enum": [ - "visa" - ], - "type": "string", - "x-enum-descriptions": [ - "Visa" - ] - }, - "network_details": { - "description": "Fields specific to the `network`", - "properties": { - "visa": { - "description": "Fields specific to the `visa` network", - "properties": { - "electronic_commerce_indicator": { - "description": "For electronic commerce transactions, this identifies the level of security used in obtaining the customer's payment credential. For mail or telephone order transactions, identifies the type of mail or telephone order.", - "enum": [ - "mail_phone_order", - "recurring", - "installment", - "unknown_mail_phone_order", - "secure_electronic_commerce", - "non_authenticated_security_transaction_at_3ds_capable_merchant", - "non_authenticated_security_transaction", - "non_secure_transaction" - ], - "nullable": true, - "type": "string", - "x-enum-descriptions": [ - "Single transaction of a mail/phone order: Use to indicate that the transaction is a mail/phone order purchase, not a recurring transaction or installment payment. For domestic transactions in the US region, this value may also indicate one bill payment transaction in the card-present or card-absent environments.", - "Recurring transaction: Payment indicator used to indicate a recurring transaction that originates from an acquirer in the US region.", - "Installment payment: Payment indicator used to indicate one purchase of goods or services that is billed to the account in multiple charges over a period of time agreed upon by the cardholder and merchant from transactions that originate from an acquirer in the US region.", - "Unknown classification: other mail order: Use to indicate that the type of mail/telephone order is unknown.", - "Secure electronic commerce transaction: Use to indicate that the electronic commerce transaction has been authenticated using e.g., 3-D Secure", - "Non-authenticated security transaction at a 3-D Secure-capable merchant, and merchant attempted to authenticate the cardholder using 3-D Secure: Use to identify an electronic commerce transaction where the merchant attempted to authenticate the cardholder using 3-D Secure, but was unable to complete the authentication because the issuer or cardholder does not participate in the 3-D Secure program.", - "Non-authenticated security transaction: Use to identify an electronic commerce transaction that uses data encryption for security however , cardholder authentication is not performed using 3-D Secure.", - "Non-secure transaction: Use to identify an electronic commerce transaction that has no data protection." - ] - }, - "point_of_service_entry_mode": { - "description": "The method used to enter the cardholder's primary account number and card expiration date", - "enum": [ - "manual", - "magnetic_stripe_no_cvv", - "optical_code", - "integrated_circuit_card", - "contactless", - "credential_on_file", - "magnetic_stripe", - "contactless_magnetic_stripe", - "integrated_circuit_card_no_cvv" - ], - "nullable": true, - "type": "string", - "x-enum-descriptions": [ - "Manual key entry", - "Magnetic stripe read, without card verification value", - "Optical code", - "Contact chip card", - "Contactless read of chip card", - "Transaction iniated using a credential that has previously been stored on file", - "Magnetic stripe read", - "Contactless read of magnetic stripe data", - "Contact chip card, without card verification value" - ] - } - }, - "required": [ - "electronic_commerce_indicator", - "point_of_service_entry_mode" - ], - "title": "Visa", - "type": "object", - "x-title-plural": "Visas" - } - }, - "required": [ - "visa" - ], - "title": "Network Details", - "type": "object", - "x-title-plural": "Network Detailss" - }, - "real_time_decision_id": { - "description": "The identifier of the Real-Time Decision sent to approve or decline this transaction.", - "nullable": true, - "type": "string" - }, - "reason": { - "description": "Why the transaction was declined.", - "enum": [ - "card_not_active", - "entity_not_active", - "group_locked", - "insufficient_funds", - "cvv2_mismatch", - "transaction_not_allowed", - "breaches_limit", - "webhook_declined", - "webhook_timed_out", - "declined_by_stand_in_processing", - "invalid_physical_card", - "missing_original_authorization" - ], - "type": "string", - "x-enum-descriptions": [ - "The Card was not active.", - "The account's entity was not active.", - "The account was inactive.", - "The Card's Account did not have a sufficient available balance.", - "The given CVV2 did not match the card's value.", - "The attempted card transaction is not allowed per Increase's terms.", - "The transaction was blocked by a Limit.", - "Your application declined the transaction via webhook.", - "Your application webhook did not respond without the required timeout.", - "Declined by stand-in processing.", - "The card read had an invalid CVV, dCVV, or authorization request cryptogram.", - "The original card authorization for this incremental authorization does not exist." - ] - } - }, - "required": [ - "merchant_acceptor_id", - "merchant_descriptor", - "merchant_category_code", - "merchant_city", - "merchant_country", - "network", - "network_details", - "amount", - "currency", - "reason", - "merchant_state", - "real_time_decision_id", - "digital_wallet_token_id" - ], - "title": "Card Decline", - "type": "object", - "x-title-plural": "Card Declines" - }, - "card_route_decline": { - "description": "A Deprecated Card Decline object. This field will be present in the JSON response if and only if `category` is equal to `card_route_decline`.", - "example": { - "amount": -1000, - "currency": "USD", - "merchant_acceptor_id": "372909060886", - "merchant_category_code": "5998", - "merchant_city": "5364086000", - "merchant_country": "USA", - "merchant_descriptor": "TENTS R US", - "merchant_state": "CA" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "currency": { - "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination account currency.", - "enum": [ - "CAD", - "CHF", - "EUR", - "GBP", - "JPY", - "USD" - ], - "type": "string", - "x-enum-descriptions": [ - "Canadian Dollar (CAD)", - "Swiss Franc (CHF)", - "Euro (EUR)", - "British Pound (GBP)", - "Japanese Yen (JPY)", - "US Dollar (USD)" - ] - }, - "merchant_acceptor_id": { - "type": "string" - }, - "merchant_category_code": { - "nullable": true, - "type": "string" - }, - "merchant_city": { - "nullable": true, - "type": "string" - }, - "merchant_country": { - "type": "string" - }, - "merchant_descriptor": { - "type": "string" - }, - "merchant_state": { - "nullable": true, - "type": "string" - } - }, - "required": [ - "amount", - "currency", - "merchant_acceptor_id", - "merchant_city", - "merchant_country", - "merchant_descriptor", - "merchant_state", - "merchant_category_code" - ], - "title": "Deprecated Card Decline", - "type": "object", - "x-title-plural": "Deprecated Card Declines" - }, - "category": { - "description": "The type of decline that took place. We may add additional possible values for this enum over time; your application should be able to handle such additions gracefully.", - "enum": [ - "ach_decline", - "card_decline", - "check_decline", - "inbound_real_time_payments_transfer_decline", - "international_ach_decline", - "card_route_decline", - "other" - ], - "type": "string", - "x-enum-descriptions": [ - "The Declined Transaction was created by a ACH Decline object. Details will be under the `ach_decline` object.", - "The Declined Transaction was created by a Card Decline object. Details will be under the `card_decline` object.", - "The Declined Transaction was created by a Check Decline object. Details will be under the `check_decline` object.", - "The Declined Transaction was created by a Inbound Real Time Payments Transfer Decline object. Details will be under the `inbound_real_time_payments_transfer_decline` object.", - "The Declined Transaction was created by a International ACH Decline object. Details will be under the `international_ach_decline` object.", - "The Declined Transaction was created by a Deprecated Card Decline object. Details will be under the `card_route_decline` object.", - "The Declined Transaction was made for an undocumented or deprecated reason." - ] - }, - "check_decline": { - "description": "A Check Decline object. This field will be present in the JSON response if and only if `category` is equal to `check_decline`.", - "example": { - "amount": -1000, - "auxiliary_on_us": "99999", - "reason": "insufficient_funds" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "auxiliary_on_us": { - "nullable": true, - "type": "string" - }, - "reason": { - "description": "Why the check was declined.", - "enum": [ - "ach_route_canceled", - "ach_route_disabled", - "breaches_limit", - "entity_not_active", - "group_locked", - "insufficient_funds", - "unable_to_locate_account", - "unable_to_process", - "refer_to_image", - "stop_payment_requested", - "returned", - "duplicate_presentment", - "not_authorized" - ], - "type": "string", - "x-enum-descriptions": [ - "The account number is canceled.", - "The account number is disabled.", - "The transaction would cause a limit to be exceeded.", - "The account's entity is not active.", - "Your account is inactive.", - "Your account contains insufficient funds.", - "Unable to locate account.", - "Unable to process.", - "Refer to image.", - "Stop payment requested for this check.", - "Check was returned to sender.", - "The check was a duplicate deposit.", - "The transaction is not allowed." - ] - } - }, - "required": [ - "amount", - "auxiliary_on_us", - "reason" - ], - "title": "Check Decline", - "type": "object", - "x-title-plural": "Check Declines" - }, - "inbound_real_time_payments_transfer_decline": { - "description": "A Inbound Real Time Payments Transfer Decline object. This field will be present in the JSON response if and only if `category` is equal to `inbound_real_time_payments_transfer_decline`.", - "example": { - "amount": 100, - "creditor_name": "Ian Crease", - "currency": "USD", - "debtor_account_number": "987654321", - "debtor_name": "National Phonograph Company", - "debtor_routing_number": "101050001", - "reason": "account_number_disabled", - "remittance_information": "Invoice 29582", - "transaction_identification": "20220501234567891T1BSLZO01745013025" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "creditor_name": { - "description": "The name the sender of the transfer specified as the recipient of the transfer.", - "type": "string" - }, - "currency": { - "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the declined transfer's currency. This will always be \"USD\" for a Real Time Payments transfer.", - "enum": [ - "CAD", - "CHF", - "EUR", - "GBP", - "JPY", - "USD" - ], - "type": "string", - "x-enum-descriptions": [ - "Canadian Dollar (CAD)", - "Swiss Franc (CHF)", - "Euro (EUR)", - "British Pound (GBP)", - "Japanese Yen (JPY)", - "US Dollar (USD)" - ] - }, - "debtor_account_number": { - "description": "The account number of the account that sent the transfer.", - "type": "string" - }, - "debtor_name": { - "description": "The name provided by the sender of the transfer.", - "type": "string" - }, - "debtor_routing_number": { - "description": "The routing number of the account that sent the transfer.", - "type": "string" - }, - "reason": { - "description": "Why the transfer was declined.", - "enum": [ - "account_number_canceled", - "account_number_disabled", - "group_locked", - "entity_not_active", - "real_time_payments_not_enabled" - ], - "type": "string", - "x-enum-descriptions": [ - "The account number is canceled.", - "The account number is disabled.", - "Your account is inactive.", - "The account's entity is not active.", - "Your account is not enabled to receive Real Time Payments transfers." - ] - }, - "remittance_information": { - "description": "Additional information included with the transfer.", - "nullable": true, - "type": "string" - }, - "transaction_identification": { - "description": "The Real Time Payments network identification of the declined transfer.", - "type": "string" - } - }, - "required": [ - "amount", - "currency", - "reason", - "creditor_name", - "debtor_name", - "debtor_account_number", - "debtor_routing_number", - "transaction_identification", - "remittance_information" - ], - "title": "Inbound Real Time Payments Transfer Decline", - "type": "object", - "x-title-plural": "Inbound Real Time Payments Transfer Declines" - }, - "international_ach_decline": { - "description": "A International ACH Decline object. This field will be present in the JSON response if and only if `category` is equal to `international_ach_decline`.", - "example": { - "amount": -1000, - "destination_country_code": "US", - "destination_currency_code": "USD", - "foreign_exchange_indicator": "fixed_to_fixed", - "foreign_exchange_reference": null, - "foreign_exchange_reference_indicator": "blank", - "foreign_payment_amount": 199, - "foreign_trace_number": null, - "international_transaction_type_code": "internet_initiated", - "originating_currency_code": "USD", - "originating_depository_financial_institution_branch_country": "US", - "originating_depository_financial_institution_id": "091000019", - "originating_depository_financial_institution_id_qualifier": "national_clearing_system_number", - "originating_depository_financial_institution_name": "WELLS FARGO BANK", - "originator_city": "BERLIN", - "originator_company_entry_description": "RETRY PYMT", - "originator_country": "DE", - "originator_identification": "770510487A", - "originator_name": "BERGHAIN", - "originator_postal_code": "50825", - "originator_state_or_province": null, - "originator_street_address": "Ruedersdorferstr. 7", - "payment_related_information": null, - "payment_related_information2": null, - "receiver_city": "BEVERLY HILLS", - "receiver_country": "US", - "receiver_identification_number": "1018790279274", - "receiver_postal_code": "90210", - "receiver_state_or_province": "CA", - "receiver_street_address": "123 FAKE ST", - "receiving_company_or_individual_name": "IAN CREASE", - "receiving_depository_financial_institution_country": "US", - "receiving_depository_financial_institution_id": "101050001", - "receiving_depository_financial_institution_id_qualifier": "national_clearing_system_number", - "receiving_depository_financial_institution_name": "BLUE RIDGE BANK, NATIONAL ASSOCIATI", - "trace_number": "010202909100090" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "destination_country_code": { - "type": "string" - }, - "destination_currency_code": { - "type": "string" - }, - "foreign_exchange_indicator": { - "type": "string" - }, - "foreign_exchange_reference": { - "nullable": true, - "type": "string" - }, - "foreign_exchange_reference_indicator": { - "type": "string" - }, - "foreign_payment_amount": { - "type": "integer" - }, - "foreign_trace_number": { - "nullable": true, - "type": "string" - }, - "international_transaction_type_code": { - "type": "string" - }, - "originating_currency_code": { - "type": "string" - }, - "originating_depository_financial_institution_branch_country": { - "type": "string" - }, - "originating_depository_financial_institution_id": { - "type": "string" - }, - "originating_depository_financial_institution_id_qualifier": { - "type": "string" - }, - "originating_depository_financial_institution_name": { - "type": "string" - }, - "originator_city": { - "type": "string" - }, - "originator_company_entry_description": { - "type": "string" - }, - "originator_country": { - "type": "string" - }, - "originator_identification": { - "type": "string" - }, - "originator_name": { - "type": "string" - }, - "originator_postal_code": { - "nullable": true, - "type": "string" - }, - "originator_state_or_province": { - "nullable": true, - "type": "string" - }, - "originator_street_address": { - "type": "string" - }, - "payment_related_information": { - "nullable": true, - "type": "string" - }, - "payment_related_information2": { - "nullable": true, - "type": "string" - }, - "receiver_city": { - "type": "string" - }, - "receiver_country": { - "type": "string" - }, - "receiver_identification_number": { - "nullable": true, - "type": "string" - }, - "receiver_postal_code": { - "nullable": true, - "type": "string" - }, - "receiver_state_or_province": { - "nullable": true, - "type": "string" - }, - "receiver_street_address": { - "type": "string" - }, - "receiving_company_or_individual_name": { - "type": "string" - }, - "receiving_depository_financial_institution_country": { - "type": "string" - }, - "receiving_depository_financial_institution_id": { - "type": "string" - }, - "receiving_depository_financial_institution_id_qualifier": { - "type": "string" - }, - "receiving_depository_financial_institution_name": { - "type": "string" - }, - "trace_number": { - "type": "string" - } - }, - "required": [ - "amount", - "foreign_exchange_indicator", - "foreign_exchange_reference_indicator", - "foreign_exchange_reference", - "destination_country_code", - "destination_currency_code", - "foreign_payment_amount", - "foreign_trace_number", - "international_transaction_type_code", - "originating_currency_code", - "originating_depository_financial_institution_name", - "originating_depository_financial_institution_id_qualifier", - "originating_depository_financial_institution_id", - "originating_depository_financial_institution_branch_country", - "originator_city", - "originator_company_entry_description", - "originator_country", - "originator_identification", - "originator_name", - "originator_postal_code", - "originator_street_address", - "originator_state_or_province", - "payment_related_information", - "payment_related_information2", - "receiver_identification_number", - "receiver_street_address", - "receiver_city", - "receiver_state_or_province", - "receiver_country", - "receiver_postal_code", - "receiving_company_or_individual_name", - "receiving_depository_financial_institution_name", - "receiving_depository_financial_institution_id_qualifier", - "receiving_depository_financial_institution_id", - "receiving_depository_financial_institution_country", - "trace_number" - ], - "title": "International ACH Decline", - "type": "object", - "x-title-plural": "International ACH Declines" - } - }, - "required": [ - "category", - "ach_decline", - "card_decline", - "check_decline", - "inbound_real_time_payments_transfer_decline", - "international_ach_decline", - "card_route_decline" - ], - "title": "Declined Transaction Source", - "type": "object", - "x-title-plural": "Declined Transaction Sources" - } - -Value: - { - "ach_decline": { - "amount": 1750, - "originator_company_descriptive_date": null, - "originator_company_discretionary_data": null, - "originator_company_id": "0987654321", - "originator_company_name": "BIG BANK", - "reason": "insufficient_funds", - "receiver_id_number": "12345678900", - "receiver_name": "IAN CREASE", - "trace_number": "021000038461022" - }, - "category": "ach_decline" - } - | Error at "/international_ach_decline": property "international_ach_decline" is missing -Schema: - { - "description": "This is an object giving more details on the network-level event that caused the Declined Transaction. For example, for a card transaction this lists the merchant's industry and location. Note that for backwards compatibility reasons, additional undocumented keys may appear in this object. These should be treated as deprecated and will be removed in the future.", - "example": { - "ach_decline": { - "amount": 1750, - "originator_company_descriptive_date": null, - "originator_company_discretionary_data": null, - "originator_company_id": "0987654321", - "originator_company_name": "BIG BANK", - "reason": "insufficient_funds", - "receiver_id_number": "12345678900", - "receiver_name": "IAN CREASE", - "trace_number": "021000038461022" - }, - "category": "ach_decline" - }, - "properties": { - "ach_decline": { - "description": "A ACH Decline object. This field will be present in the JSON response if and only if `category` is equal to `ach_decline`.", - "example": { - "amount": 1750, - "originator_company_descriptive_date": null, - "originator_company_discretionary_data": null, - "originator_company_id": "0987654321", - "originator_company_name": "BIG BANK", - "reason": "insufficient_funds", - "receiver_id_number": "12345678900", - "receiver_name": "IAN CREASE", - "trace_number": "021000038461022" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "originator_company_descriptive_date": { - "nullable": true, - "type": "string" - }, - "originator_company_discretionary_data": { - "nullable": true, - "type": "string" - }, - "originator_company_id": { - "type": "string" - }, - "originator_company_name": { - "type": "string" - }, - "reason": { - "description": "Why the ACH transfer was declined.", - "enum": [ - "ach_route_canceled", - "ach_route_disabled", - "breaches_limit", - "credit_entry_refused_by_receiver", - "duplicate_return", - "entity_not_active", - "group_locked", - "insufficient_funds", - "misrouted_return", - "no_ach_route", - "originator_request", - "transaction_not_allowed" - ], - "type": "string", - "x-enum-descriptions": [ - "The account number is canceled.", - "The account number is disabled.", - "The transaction would cause a limit to be exceeded.", - "A credit was refused.", - "Other.", - "The account's entity is not active.", - "Your account is inactive.", - "Your account contains insufficient funds.", - "Other.", - "The account number that was debited does not exist.", - "Other.", - "The transaction is not allowed per Increase's terms" - ] - }, - "receiver_id_number": { - "nullable": true, - "type": "string" - }, - "receiver_name": { - "nullable": true, - "type": "string" - }, - "trace_number": { - "type": "string" - } - }, - "required": [ - "amount", - "originator_company_name", - "originator_company_descriptive_date", - "originator_company_discretionary_data", - "originator_company_id", - "reason", - "receiver_id_number", - "receiver_name", - "trace_number" - ], - "title": "ACH Decline", - "type": "object", - "x-title-plural": "ACH Declines" - }, - "card_decline": { - "description": "A Card Decline object. This field will be present in the JSON response if and only if `category` is equal to `card_decline`.", - "example": { - "amount": -1000, - "currency": "USD", - "digital_wallet_token_id": null, - "merchant_acceptor_id": "372909060886", - "merchant_category_code": "5998", - "merchant_city": "5364086000", - "merchant_country": "USA", - "merchant_descriptor": "TENTS R US", - "merchant_state": "CA", - "network": "visa", - "network_details": { - "visa": { - "electronic_commerce_indicator": "secure_electronic_commerce", - "point_of_service_entry_mode": "manual" - } - }, - "real_time_decision_id": null, - "reason": "insufficient_funds" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "currency": { - "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination account currency.", - "enum": [ - "CAD", - "CHF", - "EUR", - "GBP", - "JPY", - "USD" - ], - "type": "string", - "x-enum-descriptions": [ - "Canadian Dollar (CAD)", - "Swiss Franc (CHF)", - "Euro (EUR)", - "British Pound (GBP)", - "Japanese Yen (JPY)", - "US Dollar (USD)" - ] - }, - "digital_wallet_token_id": { - "description": "If the authorization was attempted using a Digital Wallet Token (such as an Apple Pay purchase), the identifier of the token that was used.", - "nullable": true, - "type": "string" - }, - "merchant_acceptor_id": { - "description": "The merchant identifier (commonly abbreviated as MID) of the merchant the card is transacting with.", - "type": "string" - }, - "merchant_category_code": { - "description": "The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card is transacting with.", - "nullable": true, - "type": "string" - }, - "merchant_city": { - "description": "The city the merchant resides in.", - "nullable": true, - "type": "string" - }, - "merchant_country": { - "description": "The country the merchant resides in.", - "nullable": true, - "type": "string" - }, - "merchant_descriptor": { - "description": "The merchant descriptor of the merchant the card is transacting with.", - "type": "string" - }, - "merchant_state": { - "description": "The state the merchant resides in.", - "nullable": true, - "type": "string" - }, - "network": { - "description": "The payment network used to process this card authorization", - "enum": [ - "visa" - ], - "type": "string", - "x-enum-descriptions": [ - "Visa" - ] - }, - "network_details": { - "description": "Fields specific to the `network`", - "properties": { - "visa": { - "description": "Fields specific to the `visa` network", - "properties": { - "electronic_commerce_indicator": { - "description": "For electronic commerce transactions, this identifies the level of security used in obtaining the customer's payment credential. For mail or telephone order transactions, identifies the type of mail or telephone order.", - "enum": [ - "mail_phone_order", - "recurring", - "installment", - "unknown_mail_phone_order", - "secure_electronic_commerce", - "non_authenticated_security_transaction_at_3ds_capable_merchant", - "non_authenticated_security_transaction", - "non_secure_transaction" - ], - "nullable": true, - "type": "string", - "x-enum-descriptions": [ - "Single transaction of a mail/phone order: Use to indicate that the transaction is a mail/phone order purchase, not a recurring transaction or installment payment. For domestic transactions in the US region, this value may also indicate one bill payment transaction in the card-present or card-absent environments.", - "Recurring transaction: Payment indicator used to indicate a recurring transaction that originates from an acquirer in the US region.", - "Installment payment: Payment indicator used to indicate one purchase of goods or services that is billed to the account in multiple charges over a period of time agreed upon by the cardholder and merchant from transactions that originate from an acquirer in the US region.", - "Unknown classification: other mail order: Use to indicate that the type of mail/telephone order is unknown.", - "Secure electronic commerce transaction: Use to indicate that the electronic commerce transaction has been authenticated using e.g., 3-D Secure", - "Non-authenticated security transaction at a 3-D Secure-capable merchant, and merchant attempted to authenticate the cardholder using 3-D Secure: Use to identify an electronic commerce transaction where the merchant attempted to authenticate the cardholder using 3-D Secure, but was unable to complete the authentication because the issuer or cardholder does not participate in the 3-D Secure program.", - "Non-authenticated security transaction: Use to identify an electronic commerce transaction that uses data encryption for security however , cardholder authentication is not performed using 3-D Secure.", - "Non-secure transaction: Use to identify an electronic commerce transaction that has no data protection." - ] - }, - "point_of_service_entry_mode": { - "description": "The method used to enter the cardholder's primary account number and card expiration date", - "enum": [ - "manual", - "magnetic_stripe_no_cvv", - "optical_code", - "integrated_circuit_card", - "contactless", - "credential_on_file", - "magnetic_stripe", - "contactless_magnetic_stripe", - "integrated_circuit_card_no_cvv" - ], - "nullable": true, - "type": "string", - "x-enum-descriptions": [ - "Manual key entry", - "Magnetic stripe read, without card verification value", - "Optical code", - "Contact chip card", - "Contactless read of chip card", - "Transaction iniated using a credential that has previously been stored on file", - "Magnetic stripe read", - "Contactless read of magnetic stripe data", - "Contact chip card, without card verification value" - ] - } - }, - "required": [ - "electronic_commerce_indicator", - "point_of_service_entry_mode" - ], - "title": "Visa", - "type": "object", - "x-title-plural": "Visas" - } - }, - "required": [ - "visa" - ], - "title": "Network Details", - "type": "object", - "x-title-plural": "Network Detailss" - }, - "real_time_decision_id": { - "description": "The identifier of the Real-Time Decision sent to approve or decline this transaction.", - "nullable": true, - "type": "string" - }, - "reason": { - "description": "Why the transaction was declined.", - "enum": [ - "card_not_active", - "entity_not_active", - "group_locked", - "insufficient_funds", - "cvv2_mismatch", - "transaction_not_allowed", - "breaches_limit", - "webhook_declined", - "webhook_timed_out", - "declined_by_stand_in_processing", - "invalid_physical_card", - "missing_original_authorization" - ], - "type": "string", - "x-enum-descriptions": [ - "The Card was not active.", - "The account's entity was not active.", - "The account was inactive.", - "The Card's Account did not have a sufficient available balance.", - "The given CVV2 did not match the card's value.", - "The attempted card transaction is not allowed per Increase's terms.", - "The transaction was blocked by a Limit.", - "Your application declined the transaction via webhook.", - "Your application webhook did not respond without the required timeout.", - "Declined by stand-in processing.", - "The card read had an invalid CVV, dCVV, or authorization request cryptogram.", - "The original card authorization for this incremental authorization does not exist." - ] - } - }, - "required": [ - "merchant_acceptor_id", - "merchant_descriptor", - "merchant_category_code", - "merchant_city", - "merchant_country", - "network", - "network_details", - "amount", - "currency", - "reason", - "merchant_state", - "real_time_decision_id", - "digital_wallet_token_id" - ], - "title": "Card Decline", - "type": "object", - "x-title-plural": "Card Declines" - }, - "card_route_decline": { - "description": "A Deprecated Card Decline object. This field will be present in the JSON response if and only if `category` is equal to `card_route_decline`.", - "example": { - "amount": -1000, - "currency": "USD", - "merchant_acceptor_id": "372909060886", - "merchant_category_code": "5998", - "merchant_city": "5364086000", - "merchant_country": "USA", - "merchant_descriptor": "TENTS R US", - "merchant_state": "CA" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "currency": { - "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination account currency.", - "enum": [ - "CAD", - "CHF", - "EUR", - "GBP", - "JPY", - "USD" - ], - "type": "string", - "x-enum-descriptions": [ - "Canadian Dollar (CAD)", - "Swiss Franc (CHF)", - "Euro (EUR)", - "British Pound (GBP)", - "Japanese Yen (JPY)", - "US Dollar (USD)" - ] - }, - "merchant_acceptor_id": { - "type": "string" - }, - "merchant_category_code": { - "nullable": true, - "type": "string" - }, - "merchant_city": { - "nullable": true, - "type": "string" - }, - "merchant_country": { - "type": "string" - }, - "merchant_descriptor": { - "type": "string" - }, - "merchant_state": { - "nullable": true, - "type": "string" - } - }, - "required": [ - "amount", - "currency", - "merchant_acceptor_id", - "merchant_city", - "merchant_country", - "merchant_descriptor", - "merchant_state", - "merchant_category_code" - ], - "title": "Deprecated Card Decline", - "type": "object", - "x-title-plural": "Deprecated Card Declines" - }, - "category": { - "description": "The type of decline that took place. We may add additional possible values for this enum over time; your application should be able to handle such additions gracefully.", - "enum": [ - "ach_decline", - "card_decline", - "check_decline", - "inbound_real_time_payments_transfer_decline", - "international_ach_decline", - "card_route_decline", - "other" - ], - "type": "string", - "x-enum-descriptions": [ - "The Declined Transaction was created by a ACH Decline object. Details will be under the `ach_decline` object.", - "The Declined Transaction was created by a Card Decline object. Details will be under the `card_decline` object.", - "The Declined Transaction was created by a Check Decline object. Details will be under the `check_decline` object.", - "The Declined Transaction was created by a Inbound Real Time Payments Transfer Decline object. Details will be under the `inbound_real_time_payments_transfer_decline` object.", - "The Declined Transaction was created by a International ACH Decline object. Details will be under the `international_ach_decline` object.", - "The Declined Transaction was created by a Deprecated Card Decline object. Details will be under the `card_route_decline` object.", - "The Declined Transaction was made for an undocumented or deprecated reason." - ] - }, - "check_decline": { - "description": "A Check Decline object. This field will be present in the JSON response if and only if `category` is equal to `check_decline`.", - "example": { - "amount": -1000, - "auxiliary_on_us": "99999", - "reason": "insufficient_funds" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "auxiliary_on_us": { - "nullable": true, - "type": "string" - }, - "reason": { - "description": "Why the check was declined.", - "enum": [ - "ach_route_canceled", - "ach_route_disabled", - "breaches_limit", - "entity_not_active", - "group_locked", - "insufficient_funds", - "unable_to_locate_account", - "unable_to_process", - "refer_to_image", - "stop_payment_requested", - "returned", - "duplicate_presentment", - "not_authorized" - ], - "type": "string", - "x-enum-descriptions": [ - "The account number is canceled.", - "The account number is disabled.", - "The transaction would cause a limit to be exceeded.", - "The account's entity is not active.", - "Your account is inactive.", - "Your account contains insufficient funds.", - "Unable to locate account.", - "Unable to process.", - "Refer to image.", - "Stop payment requested for this check.", - "Check was returned to sender.", - "The check was a duplicate deposit.", - "The transaction is not allowed." - ] - } - }, - "required": [ - "amount", - "auxiliary_on_us", - "reason" - ], - "title": "Check Decline", - "type": "object", - "x-title-plural": "Check Declines" - }, - "inbound_real_time_payments_transfer_decline": { - "description": "A Inbound Real Time Payments Transfer Decline object. This field will be present in the JSON response if and only if `category` is equal to `inbound_real_time_payments_transfer_decline`.", - "example": { - "amount": 100, - "creditor_name": "Ian Crease", - "currency": "USD", - "debtor_account_number": "987654321", - "debtor_name": "National Phonograph Company", - "debtor_routing_number": "101050001", - "reason": "account_number_disabled", - "remittance_information": "Invoice 29582", - "transaction_identification": "20220501234567891T1BSLZO01745013025" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "creditor_name": { - "description": "The name the sender of the transfer specified as the recipient of the transfer.", - "type": "string" - }, - "currency": { - "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the declined transfer's currency. This will always be \"USD\" for a Real Time Payments transfer.", - "enum": [ - "CAD", - "CHF", - "EUR", - "GBP", - "JPY", - "USD" - ], - "type": "string", - "x-enum-descriptions": [ - "Canadian Dollar (CAD)", - "Swiss Franc (CHF)", - "Euro (EUR)", - "British Pound (GBP)", - "Japanese Yen (JPY)", - "US Dollar (USD)" - ] - }, - "debtor_account_number": { - "description": "The account number of the account that sent the transfer.", - "type": "string" - }, - "debtor_name": { - "description": "The name provided by the sender of the transfer.", - "type": "string" - }, - "debtor_routing_number": { - "description": "The routing number of the account that sent the transfer.", - "type": "string" - }, - "reason": { - "description": "Why the transfer was declined.", - "enum": [ - "account_number_canceled", - "account_number_disabled", - "group_locked", - "entity_not_active", - "real_time_payments_not_enabled" - ], - "type": "string", - "x-enum-descriptions": [ - "The account number is canceled.", - "The account number is disabled.", - "Your account is inactive.", - "The account's entity is not active.", - "Your account is not enabled to receive Real Time Payments transfers." - ] - }, - "remittance_information": { - "description": "Additional information included with the transfer.", - "nullable": true, - "type": "string" - }, - "transaction_identification": { - "description": "The Real Time Payments network identification of the declined transfer.", - "type": "string" - } - }, - "required": [ - "amount", - "currency", - "reason", - "creditor_name", - "debtor_name", - "debtor_account_number", - "debtor_routing_number", - "transaction_identification", - "remittance_information" - ], - "title": "Inbound Real Time Payments Transfer Decline", - "type": "object", - "x-title-plural": "Inbound Real Time Payments Transfer Declines" - }, - "international_ach_decline": { - "description": "A International ACH Decline object. This field will be present in the JSON response if and only if `category` is equal to `international_ach_decline`.", - "example": { - "amount": -1000, - "destination_country_code": "US", - "destination_currency_code": "USD", - "foreign_exchange_indicator": "fixed_to_fixed", - "foreign_exchange_reference": null, - "foreign_exchange_reference_indicator": "blank", - "foreign_payment_amount": 199, - "foreign_trace_number": null, - "international_transaction_type_code": "internet_initiated", - "originating_currency_code": "USD", - "originating_depository_financial_institution_branch_country": "US", - "originating_depository_financial_institution_id": "091000019", - "originating_depository_financial_institution_id_qualifier": "national_clearing_system_number", - "originating_depository_financial_institution_name": "WELLS FARGO BANK", - "originator_city": "BERLIN", - "originator_company_entry_description": "RETRY PYMT", - "originator_country": "DE", - "originator_identification": "770510487A", - "originator_name": "BERGHAIN", - "originator_postal_code": "50825", - "originator_state_or_province": null, - "originator_street_address": "Ruedersdorferstr. 7", - "payment_related_information": null, - "payment_related_information2": null, - "receiver_city": "BEVERLY HILLS", - "receiver_country": "US", - "receiver_identification_number": "1018790279274", - "receiver_postal_code": "90210", - "receiver_state_or_province": "CA", - "receiver_street_address": "123 FAKE ST", - "receiving_company_or_individual_name": "IAN CREASE", - "receiving_depository_financial_institution_country": "US", - "receiving_depository_financial_institution_id": "101050001", - "receiving_depository_financial_institution_id_qualifier": "national_clearing_system_number", - "receiving_depository_financial_institution_name": "BLUE RIDGE BANK, NATIONAL ASSOCIATI", - "trace_number": "010202909100090" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "destination_country_code": { - "type": "string" - }, - "destination_currency_code": { - "type": "string" - }, - "foreign_exchange_indicator": { - "type": "string" - }, - "foreign_exchange_reference": { - "nullable": true, - "type": "string" - }, - "foreign_exchange_reference_indicator": { - "type": "string" - }, - "foreign_payment_amount": { - "type": "integer" - }, - "foreign_trace_number": { - "nullable": true, - "type": "string" - }, - "international_transaction_type_code": { - "type": "string" - }, - "originating_currency_code": { - "type": "string" - }, - "originating_depository_financial_institution_branch_country": { - "type": "string" - }, - "originating_depository_financial_institution_id": { - "type": "string" - }, - "originating_depository_financial_institution_id_qualifier": { - "type": "string" - }, - "originating_depository_financial_institution_name": { - "type": "string" - }, - "originator_city": { - "type": "string" - }, - "originator_company_entry_description": { - "type": "string" - }, - "originator_country": { - "type": "string" - }, - "originator_identification": { - "type": "string" - }, - "originator_name": { - "type": "string" - }, - "originator_postal_code": { - "nullable": true, - "type": "string" - }, - "originator_state_or_province": { - "nullable": true, - "type": "string" - }, - "originator_street_address": { - "type": "string" - }, - "payment_related_information": { - "nullable": true, - "type": "string" - }, - "payment_related_information2": { - "nullable": true, - "type": "string" - }, - "receiver_city": { - "type": "string" - }, - "receiver_country": { - "type": "string" - }, - "receiver_identification_number": { - "nullable": true, - "type": "string" - }, - "receiver_postal_code": { - "nullable": true, - "type": "string" - }, - "receiver_state_or_province": { - "nullable": true, - "type": "string" - }, - "receiver_street_address": { - "type": "string" - }, - "receiving_company_or_individual_name": { - "type": "string" - }, - "receiving_depository_financial_institution_country": { - "type": "string" - }, - "receiving_depository_financial_institution_id": { - "type": "string" - }, - "receiving_depository_financial_institution_id_qualifier": { - "type": "string" - }, - "receiving_depository_financial_institution_name": { - "type": "string" - }, - "trace_number": { - "type": "string" - } - }, - "required": [ - "amount", - "foreign_exchange_indicator", - "foreign_exchange_reference_indicator", - "foreign_exchange_reference", - "destination_country_code", - "destination_currency_code", - "foreign_payment_amount", - "foreign_trace_number", - "international_transaction_type_code", - "originating_currency_code", - "originating_depository_financial_institution_name", - "originating_depository_financial_institution_id_qualifier", - "originating_depository_financial_institution_id", - "originating_depository_financial_institution_branch_country", - "originator_city", - "originator_company_entry_description", - "originator_country", - "originator_identification", - "originator_name", - "originator_postal_code", - "originator_street_address", - "originator_state_or_province", - "payment_related_information", - "payment_related_information2", - "receiver_identification_number", - "receiver_street_address", - "receiver_city", - "receiver_state_or_province", - "receiver_country", - "receiver_postal_code", - "receiving_company_or_individual_name", - "receiving_depository_financial_institution_name", - "receiving_depository_financial_institution_id_qualifier", - "receiving_depository_financial_institution_id", - "receiving_depository_financial_institution_country", - "trace_number" - ], - "title": "International ACH Decline", - "type": "object", - "x-title-plural": "International ACH Declines" - } - }, - "required": [ - "category", - "ach_decline", - "card_decline", - "check_decline", - "inbound_real_time_payments_transfer_decline", - "international_ach_decline", - "card_route_decline" - ], - "title": "Declined Transaction Source", - "type": "object", - "x-title-plural": "Declined Transaction Sources" - } - -Value: - { - "ach_decline": { - "amount": 1750, - "originator_company_descriptive_date": null, - "originator_company_discretionary_data": null, - "originator_company_id": "0987654321", - "originator_company_name": "BIG BANK", - "reason": "insufficient_funds", - "receiver_id_number": "12345678900", - "receiver_name": "IAN CREASE", - "trace_number": "021000038461022" - }, - "category": "ach_decline" - } - | Error at "/card_route_decline": property "card_route_decline" is missing -Schema: - { - "description": "This is an object giving more details on the network-level event that caused the Declined Transaction. For example, for a card transaction this lists the merchant's industry and location. Note that for backwards compatibility reasons, additional undocumented keys may appear in this object. These should be treated as deprecated and will be removed in the future.", - "example": { - "ach_decline": { - "amount": 1750, - "originator_company_descriptive_date": null, - "originator_company_discretionary_data": null, - "originator_company_id": "0987654321", - "originator_company_name": "BIG BANK", - "reason": "insufficient_funds", - "receiver_id_number": "12345678900", - "receiver_name": "IAN CREASE", - "trace_number": "021000038461022" - }, - "category": "ach_decline" - }, - "properties": { - "ach_decline": { - "description": "A ACH Decline object. This field will be present in the JSON response if and only if `category` is equal to `ach_decline`.", - "example": { - "amount": 1750, - "originator_company_descriptive_date": null, - "originator_company_discretionary_data": null, - "originator_company_id": "0987654321", - "originator_company_name": "BIG BANK", - "reason": "insufficient_funds", - "receiver_id_number": "12345678900", - "receiver_name": "IAN CREASE", - "trace_number": "021000038461022" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "originator_company_descriptive_date": { - "nullable": true, - "type": "string" - }, - "originator_company_discretionary_data": { - "nullable": true, - "type": "string" - }, - "originator_company_id": { - "type": "string" - }, - "originator_company_name": { - "type": "string" - }, - "reason": { - "description": "Why the ACH transfer was declined.", - "enum": [ - "ach_route_canceled", - "ach_route_disabled", - "breaches_limit", - "credit_entry_refused_by_receiver", - "duplicate_return", - "entity_not_active", - "group_locked", - "insufficient_funds", - "misrouted_return", - "no_ach_route", - "originator_request", - "transaction_not_allowed" - ], - "type": "string", - "x-enum-descriptions": [ - "The account number is canceled.", - "The account number is disabled.", - "The transaction would cause a limit to be exceeded.", - "A credit was refused.", - "Other.", - "The account's entity is not active.", - "Your account is inactive.", - "Your account contains insufficient funds.", - "Other.", - "The account number that was debited does not exist.", - "Other.", - "The transaction is not allowed per Increase's terms" - ] - }, - "receiver_id_number": { - "nullable": true, - "type": "string" - }, - "receiver_name": { - "nullable": true, - "type": "string" - }, - "trace_number": { - "type": "string" - } - }, - "required": [ - "amount", - "originator_company_name", - "originator_company_descriptive_date", - "originator_company_discretionary_data", - "originator_company_id", - "reason", - "receiver_id_number", - "receiver_name", - "trace_number" - ], - "title": "ACH Decline", - "type": "object", - "x-title-plural": "ACH Declines" - }, - "card_decline": { - "description": "A Card Decline object. This field will be present in the JSON response if and only if `category` is equal to `card_decline`.", - "example": { - "amount": -1000, - "currency": "USD", - "digital_wallet_token_id": null, - "merchant_acceptor_id": "372909060886", - "merchant_category_code": "5998", - "merchant_city": "5364086000", - "merchant_country": "USA", - "merchant_descriptor": "TENTS R US", - "merchant_state": "CA", - "network": "visa", - "network_details": { - "visa": { - "electronic_commerce_indicator": "secure_electronic_commerce", - "point_of_service_entry_mode": "manual" - } - }, - "real_time_decision_id": null, - "reason": "insufficient_funds" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "currency": { - "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination account currency.", - "enum": [ - "CAD", - "CHF", - "EUR", - "GBP", - "JPY", - "USD" - ], - "type": "string", - "x-enum-descriptions": [ - "Canadian Dollar (CAD)", - "Swiss Franc (CHF)", - "Euro (EUR)", - "British Pound (GBP)", - "Japanese Yen (JPY)", - "US Dollar (USD)" - ] - }, - "digital_wallet_token_id": { - "description": "If the authorization was attempted using a Digital Wallet Token (such as an Apple Pay purchase), the identifier of the token that was used.", - "nullable": true, - "type": "string" - }, - "merchant_acceptor_id": { - "description": "The merchant identifier (commonly abbreviated as MID) of the merchant the card is transacting with.", - "type": "string" - }, - "merchant_category_code": { - "description": "The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card is transacting with.", - "nullable": true, - "type": "string" - }, - "merchant_city": { - "description": "The city the merchant resides in.", - "nullable": true, - "type": "string" - }, - "merchant_country": { - "description": "The country the merchant resides in.", - "nullable": true, - "type": "string" - }, - "merchant_descriptor": { - "description": "The merchant descriptor of the merchant the card is transacting with.", - "type": "string" - }, - "merchant_state": { - "description": "The state the merchant resides in.", - "nullable": true, - "type": "string" - }, - "network": { - "description": "The payment network used to process this card authorization", - "enum": [ - "visa" - ], - "type": "string", - "x-enum-descriptions": [ - "Visa" - ] - }, - "network_details": { - "description": "Fields specific to the `network`", - "properties": { - "visa": { - "description": "Fields specific to the `visa` network", - "properties": { - "electronic_commerce_indicator": { - "description": "For electronic commerce transactions, this identifies the level of security used in obtaining the customer's payment credential. For mail or telephone order transactions, identifies the type of mail or telephone order.", - "enum": [ - "mail_phone_order", - "recurring", - "installment", - "unknown_mail_phone_order", - "secure_electronic_commerce", - "non_authenticated_security_transaction_at_3ds_capable_merchant", - "non_authenticated_security_transaction", - "non_secure_transaction" - ], - "nullable": true, - "type": "string", - "x-enum-descriptions": [ - "Single transaction of a mail/phone order: Use to indicate that the transaction is a mail/phone order purchase, not a recurring transaction or installment payment. For domestic transactions in the US region, this value may also indicate one bill payment transaction in the card-present or card-absent environments.", - "Recurring transaction: Payment indicator used to indicate a recurring transaction that originates from an acquirer in the US region.", - "Installment payment: Payment indicator used to indicate one purchase of goods or services that is billed to the account in multiple charges over a period of time agreed upon by the cardholder and merchant from transactions that originate from an acquirer in the US region.", - "Unknown classification: other mail order: Use to indicate that the type of mail/telephone order is unknown.", - "Secure electronic commerce transaction: Use to indicate that the electronic commerce transaction has been authenticated using e.g., 3-D Secure", - "Non-authenticated security transaction at a 3-D Secure-capable merchant, and merchant attempted to authenticate the cardholder using 3-D Secure: Use to identify an electronic commerce transaction where the merchant attempted to authenticate the cardholder using 3-D Secure, but was unable to complete the authentication because the issuer or cardholder does not participate in the 3-D Secure program.", - "Non-authenticated security transaction: Use to identify an electronic commerce transaction that uses data encryption for security however , cardholder authentication is not performed using 3-D Secure.", - "Non-secure transaction: Use to identify an electronic commerce transaction that has no data protection." - ] - }, - "point_of_service_entry_mode": { - "description": "The method used to enter the cardholder's primary account number and card expiration date", - "enum": [ - "manual", - "magnetic_stripe_no_cvv", - "optical_code", - "integrated_circuit_card", - "contactless", - "credential_on_file", - "magnetic_stripe", - "contactless_magnetic_stripe", - "integrated_circuit_card_no_cvv" - ], - "nullable": true, - "type": "string", - "x-enum-descriptions": [ - "Manual key entry", - "Magnetic stripe read, without card verification value", - "Optical code", - "Contact chip card", - "Contactless read of chip card", - "Transaction iniated using a credential that has previously been stored on file", - "Magnetic stripe read", - "Contactless read of magnetic stripe data", - "Contact chip card, without card verification value" - ] - } - }, - "required": [ - "electronic_commerce_indicator", - "point_of_service_entry_mode" - ], - "title": "Visa", - "type": "object", - "x-title-plural": "Visas" - } - }, - "required": [ - "visa" - ], - "title": "Network Details", - "type": "object", - "x-title-plural": "Network Detailss" - }, - "real_time_decision_id": { - "description": "The identifier of the Real-Time Decision sent to approve or decline this transaction.", - "nullable": true, - "type": "string" - }, - "reason": { - "description": "Why the transaction was declined.", - "enum": [ - "card_not_active", - "entity_not_active", - "group_locked", - "insufficient_funds", - "cvv2_mismatch", - "transaction_not_allowed", - "breaches_limit", - "webhook_declined", - "webhook_timed_out", - "declined_by_stand_in_processing", - "invalid_physical_card", - "missing_original_authorization" - ], - "type": "string", - "x-enum-descriptions": [ - "The Card was not active.", - "The account's entity was not active.", - "The account was inactive.", - "The Card's Account did not have a sufficient available balance.", - "The given CVV2 did not match the card's value.", - "The attempted card transaction is not allowed per Increase's terms.", - "The transaction was blocked by a Limit.", - "Your application declined the transaction via webhook.", - "Your application webhook did not respond without the required timeout.", - "Declined by stand-in processing.", - "The card read had an invalid CVV, dCVV, or authorization request cryptogram.", - "The original card authorization for this incremental authorization does not exist." - ] - } - }, - "required": [ - "merchant_acceptor_id", - "merchant_descriptor", - "merchant_category_code", - "merchant_city", - "merchant_country", - "network", - "network_details", - "amount", - "currency", - "reason", - "merchant_state", - "real_time_decision_id", - "digital_wallet_token_id" - ], - "title": "Card Decline", - "type": "object", - "x-title-plural": "Card Declines" - }, - "card_route_decline": { - "description": "A Deprecated Card Decline object. This field will be present in the JSON response if and only if `category` is equal to `card_route_decline`.", - "example": { - "amount": -1000, - "currency": "USD", - "merchant_acceptor_id": "372909060886", - "merchant_category_code": "5998", - "merchant_city": "5364086000", - "merchant_country": "USA", - "merchant_descriptor": "TENTS R US", - "merchant_state": "CA" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "currency": { - "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination account currency.", - "enum": [ - "CAD", - "CHF", - "EUR", - "GBP", - "JPY", - "USD" - ], - "type": "string", - "x-enum-descriptions": [ - "Canadian Dollar (CAD)", - "Swiss Franc (CHF)", - "Euro (EUR)", - "British Pound (GBP)", - "Japanese Yen (JPY)", - "US Dollar (USD)" - ] - }, - "merchant_acceptor_id": { - "type": "string" - }, - "merchant_category_code": { - "nullable": true, - "type": "string" - }, - "merchant_city": { - "nullable": true, - "type": "string" - }, - "merchant_country": { - "type": "string" - }, - "merchant_descriptor": { - "type": "string" - }, - "merchant_state": { - "nullable": true, - "type": "string" - } - }, - "required": [ - "amount", - "currency", - "merchant_acceptor_id", - "merchant_city", - "merchant_country", - "merchant_descriptor", - "merchant_state", - "merchant_category_code" - ], - "title": "Deprecated Card Decline", - "type": "object", - "x-title-plural": "Deprecated Card Declines" - }, - "category": { - "description": "The type of decline that took place. We may add additional possible values for this enum over time; your application should be able to handle such additions gracefully.", - "enum": [ - "ach_decline", - "card_decline", - "check_decline", - "inbound_real_time_payments_transfer_decline", - "international_ach_decline", - "card_route_decline", - "other" - ], - "type": "string", - "x-enum-descriptions": [ - "The Declined Transaction was created by a ACH Decline object. Details will be under the `ach_decline` object.", - "The Declined Transaction was created by a Card Decline object. Details will be under the `card_decline` object.", - "The Declined Transaction was created by a Check Decline object. Details will be under the `check_decline` object.", - "The Declined Transaction was created by a Inbound Real Time Payments Transfer Decline object. Details will be under the `inbound_real_time_payments_transfer_decline` object.", - "The Declined Transaction was created by a International ACH Decline object. Details will be under the `international_ach_decline` object.", - "The Declined Transaction was created by a Deprecated Card Decline object. Details will be under the `card_route_decline` object.", - "The Declined Transaction was made for an undocumented or deprecated reason." - ] - }, - "check_decline": { - "description": "A Check Decline object. This field will be present in the JSON response if and only if `category` is equal to `check_decline`.", - "example": { - "amount": -1000, - "auxiliary_on_us": "99999", - "reason": "insufficient_funds" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "auxiliary_on_us": { - "nullable": true, - "type": "string" - }, - "reason": { - "description": "Why the check was declined.", - "enum": [ - "ach_route_canceled", - "ach_route_disabled", - "breaches_limit", - "entity_not_active", - "group_locked", - "insufficient_funds", - "unable_to_locate_account", - "unable_to_process", - "refer_to_image", - "stop_payment_requested", - "returned", - "duplicate_presentment", - "not_authorized" - ], - "type": "string", - "x-enum-descriptions": [ - "The account number is canceled.", - "The account number is disabled.", - "The transaction would cause a limit to be exceeded.", - "The account's entity is not active.", - "Your account is inactive.", - "Your account contains insufficient funds.", - "Unable to locate account.", - "Unable to process.", - "Refer to image.", - "Stop payment requested for this check.", - "Check was returned to sender.", - "The check was a duplicate deposit.", - "The transaction is not allowed." - ] - } - }, - "required": [ - "amount", - "auxiliary_on_us", - "reason" - ], - "title": "Check Decline", - "type": "object", - "x-title-plural": "Check Declines" - }, - "inbound_real_time_payments_transfer_decline": { - "description": "A Inbound Real Time Payments Transfer Decline object. This field will be present in the JSON response if and only if `category` is equal to `inbound_real_time_payments_transfer_decline`.", - "example": { - "amount": 100, - "creditor_name": "Ian Crease", - "currency": "USD", - "debtor_account_number": "987654321", - "debtor_name": "National Phonograph Company", - "debtor_routing_number": "101050001", - "reason": "account_number_disabled", - "remittance_information": "Invoice 29582", - "transaction_identification": "20220501234567891T1BSLZO01745013025" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "creditor_name": { - "description": "The name the sender of the transfer specified as the recipient of the transfer.", - "type": "string" - }, - "currency": { - "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the declined transfer's currency. This will always be \"USD\" for a Real Time Payments transfer.", - "enum": [ - "CAD", - "CHF", - "EUR", - "GBP", - "JPY", - "USD" - ], - "type": "string", - "x-enum-descriptions": [ - "Canadian Dollar (CAD)", - "Swiss Franc (CHF)", - "Euro (EUR)", - "British Pound (GBP)", - "Japanese Yen (JPY)", - "US Dollar (USD)" - ] - }, - "debtor_account_number": { - "description": "The account number of the account that sent the transfer.", - "type": "string" - }, - "debtor_name": { - "description": "The name provided by the sender of the transfer.", - "type": "string" - }, - "debtor_routing_number": { - "description": "The routing number of the account that sent the transfer.", - "type": "string" - }, - "reason": { - "description": "Why the transfer was declined.", - "enum": [ - "account_number_canceled", - "account_number_disabled", - "group_locked", - "entity_not_active", - "real_time_payments_not_enabled" - ], - "type": "string", - "x-enum-descriptions": [ - "The account number is canceled.", - "The account number is disabled.", - "Your account is inactive.", - "The account's entity is not active.", - "Your account is not enabled to receive Real Time Payments transfers." - ] - }, - "remittance_information": { - "description": "Additional information included with the transfer.", - "nullable": true, - "type": "string" - }, - "transaction_identification": { - "description": "The Real Time Payments network identification of the declined transfer.", - "type": "string" - } - }, - "required": [ - "amount", - "currency", - "reason", - "creditor_name", - "debtor_name", - "debtor_account_number", - "debtor_routing_number", - "transaction_identification", - "remittance_information" - ], - "title": "Inbound Real Time Payments Transfer Decline", - "type": "object", - "x-title-plural": "Inbound Real Time Payments Transfer Declines" - }, - "international_ach_decline": { - "description": "A International ACH Decline object. This field will be present in the JSON response if and only if `category` is equal to `international_ach_decline`.", - "example": { - "amount": -1000, - "destination_country_code": "US", - "destination_currency_code": "USD", - "foreign_exchange_indicator": "fixed_to_fixed", - "foreign_exchange_reference": null, - "foreign_exchange_reference_indicator": "blank", - "foreign_payment_amount": 199, - "foreign_trace_number": null, - "international_transaction_type_code": "internet_initiated", - "originating_currency_code": "USD", - "originating_depository_financial_institution_branch_country": "US", - "originating_depository_financial_institution_id": "091000019", - "originating_depository_financial_institution_id_qualifier": "national_clearing_system_number", - "originating_depository_financial_institution_name": "WELLS FARGO BANK", - "originator_city": "BERLIN", - "originator_company_entry_description": "RETRY PYMT", - "originator_country": "DE", - "originator_identification": "770510487A", - "originator_name": "BERGHAIN", - "originator_postal_code": "50825", - "originator_state_or_province": null, - "originator_street_address": "Ruedersdorferstr. 7", - "payment_related_information": null, - "payment_related_information2": null, - "receiver_city": "BEVERLY HILLS", - "receiver_country": "US", - "receiver_identification_number": "1018790279274", - "receiver_postal_code": "90210", - "receiver_state_or_province": "CA", - "receiver_street_address": "123 FAKE ST", - "receiving_company_or_individual_name": "IAN CREASE", - "receiving_depository_financial_institution_country": "US", - "receiving_depository_financial_institution_id": "101050001", - "receiving_depository_financial_institution_id_qualifier": "national_clearing_system_number", - "receiving_depository_financial_institution_name": "BLUE RIDGE BANK, NATIONAL ASSOCIATI", - "trace_number": "010202909100090" - }, - "nullable": true, - "properties": { - "amount": { - "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", - "type": "integer" - }, - "destination_country_code": { - "type": "string" - }, - "destination_currency_code": { - "type": "string" - }, - "foreign_exchange_indicator": { - "type": "string" - }, - "foreign_exchange_reference": { - "nullable": true, - "type": "string" - }, - "foreign_exchange_reference_indicator": { - "type": "string" - }, - "foreign_payment_amount": { - "type": "integer" - }, - "foreign_trace_number": { - "nullable": true, - "type": "string" - }, - "international_transaction_type_code": { - "type": "string" - }, - "originating_currency_code": { - "type": "string" - }, - "originating_depository_financial_institution_branch_country": { - "type": "string" - }, - "originating_depository_financial_institution_id": { - "type": "string" - }, - "originating_depository_financial_institution_id_qualifier": { - "type": "string" - }, - "originating_depository_financial_institution_name": { - "type": "string" - }, - "originator_city": { - "type": "string" - }, - "originator_company_entry_description": { - "type": "string" - }, - "originator_country": { - "type": "string" - }, - "originator_identification": { - "type": "string" - }, - "originator_name": { - "type": "string" - }, - "originator_postal_code": { - "nullable": true, - "type": "string" - }, - "originator_state_or_province": { - "nullable": true, - "type": "string" - }, - "originator_street_address": { - "type": "string" - }, - "payment_related_information": { - "nullable": true, - "type": "string" - }, - "payment_related_information2": { - "nullable": true, - "type": "string" - }, - "receiver_city": { - "type": "string" - }, - "receiver_country": { - "type": "string" - }, - "receiver_identification_number": { - "nullable": true, - "type": "string" - }, - "receiver_postal_code": { - "nullable": true, - "type": "string" - }, - "receiver_state_or_province": { - "nullable": true, - "type": "string" - }, - "receiver_street_address": { - "type": "string" - }, - "receiving_company_or_individual_name": { - "type": "string" - }, - "receiving_depository_financial_institution_country": { - "type": "string" - }, - "receiving_depository_financial_institution_id": { - "type": "string" - }, - "receiving_depository_financial_institution_id_qualifier": { - "type": "string" - }, - "receiving_depository_financial_institution_name": { - "type": "string" - }, - "trace_number": { - "type": "string" - } - }, - "required": [ - "amount", - "foreign_exchange_indicator", - "foreign_exchange_reference_indicator", - "foreign_exchange_reference", - "destination_country_code", - "destination_currency_code", - "foreign_payment_amount", - "foreign_trace_number", - "international_transaction_type_code", - "originating_currency_code", - "originating_depository_financial_institution_name", - "originating_depository_financial_institution_id_qualifier", - "originating_depository_financial_institution_id", - "originating_depository_financial_institution_branch_country", - "originator_city", - "originator_company_entry_description", - "originator_country", - "originator_identification", - "originator_name", - "originator_postal_code", - "originator_street_address", - "originator_state_or_province", - "payment_related_information", - "payment_related_information2", - "receiver_identification_number", - "receiver_street_address", - "receiver_city", - "receiver_state_or_province", - "receiver_country", - "receiver_postal_code", - "receiving_company_or_individual_name", - "receiving_depository_financial_institution_name", - "receiving_depository_financial_institution_id_qualifier", - "receiving_depository_financial_institution_id", - "receiving_depository_financial_institution_country", - "trace_number" - ], - "title": "International ACH Decline", - "type": "object", - "x-title-plural": "International ACH Declines" - } - }, - "required": [ - "category", - "ach_decline", - "card_decline", - "check_decline", - "inbound_real_time_payments_transfer_decline", - "international_ach_decline", - "card_route_decline" - ], - "title": "Declined Transaction Source", - "type": "object", - "x-title-plural": "Declined Transaction Sources" - } - -Value: - { - "ach_decline": { - "amount": 1750, - "originator_company_descriptive_date": null, - "originator_company_discretionary_data": null, - "originator_company_id": "0987654321", - "originator_company_name": "BIG BANK", - "reason": "insufficient_funds", - "receiver_id_number": "12345678900", - "receiver_name": "IAN CREASE", - "trace_number": "021000038461022" - }, - "category": "ach_decline" - } + "2020-01-31T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/intellifi_nl_2_23_4+0_gb463b49_dirty_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/intellifi_nl_2_23_4+0_gb463b49_dirty_openapi_yaml__validate index 8bdeed071..dde0141ec 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/intellifi_nl_2_23_4+0_gb463b49_dirty_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/intellifi_nl_2_23_4+0_gb463b49_dirty_openapi_yaml__validate @@ -1 +1,12 @@ -invalid components: schema "Item": invalid allOf element: invalid oneOf element: extra sibling fields: [description] +invalid components: schema "Blob": invalid example: unhandled value of type time.Time +Schema: + { + "description": "[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) formatted string for when this resource was created.", + "example": "2018-08-30T09:51:59.737Z", + "format": "dateTime", + "readOnly": true, + "type": "string" + } + +Value: + "2018-08-30T09:51:59.737Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/ipqualityscore_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/ipqualityscore_com_1_0_0_openapi_yaml__validate new file mode 100644 index 000000000..70f9f73f2 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/ipqualityscore_com_1_0_0_openapi_yaml__validate @@ -0,0 +1,9 @@ +invalid paths: invalid path /json/email/{YOUR_API_KEY_HERE}/{USER_EMAIL_HERE}: invalid operation GET: invalid example: unhandled value of type time.Time +Schema: + { + "example": "2013-09-10T14:18:53-04:00", + "type": "string" + } + +Value: + "2013-09-10T14:18:53-04:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/klarna_com_payments_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/klarna_com_payments_1_0_0_openapi_yaml__validate new file mode 100644 index 000000000..ac01c0ed3 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/klarna_com_payments_1_0_0_openapi_yaml__validate @@ -0,0 +1,10 @@ +invalid components: schema "create_order_request": invalid example: unhandled value of type time.Time +Schema: + { + "description": "Customer’s date of birth. The format is ‘yyyy-mm-dd’", + "example": "1978-12-31T00:00:00Z", + "type": "string" + } + +Value: + "1978-12-31T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/lgtm_com_v1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/lgtm_com_v1_0_openapi_yaml__validate index 3003bf1a9..b08e7c97d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/lgtm_com_v1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/lgtm_com_v1_0_openapi_yaml__validate @@ -1,172 +1,20 @@ -invalid components: schema "operation": invalid example: Error at "/task-result": doesn't match schema due to: value must be an object +invalid components: schema "analysis": invalid example: Error at "/analysis-date": unhandled value of type time.Time Schema: { - "example": { - "commit-id": "04d7a2300feec9bbcc48185e370e3b5d3ae4da9d", - "id": "2e65208b2f1872634132566a1a0ce6392407297c", - "languages": [ - { - "alerts": 628, - "analysis-date": "2000-01-23T04:56:07.000+00:00", - "commit-date": "2000-01-23T04:56:07.000+00:00", - "commit-id": "04d7a2300feec9bbcc48185e370e3b5d3ae4da9d", - "language": "javascript", - "lines": 133298, - "status": "success" - }, - { - "alerts": 628, - "analysis-date": "2000-01-23T04:56:07.000+00:00", - "commit-date": "2000-01-23T04:56:07.000+00:00", - "commit-id": "04d7a2300feec9bbcc48185e370e3b5d3ae4da9d", - "language": "javascript", - "lines": 133298, - "status": "success" - } - ], - "log-url": "https://lgtm.example.com/projects/g/yarnpkg/yarn/logs/analysis/2e65208b2f1872634132566a1a0ce6392407297c", - "project": { - "id": 1234567, - "name": "Apache Commons IO", - "url": "https://lgtm.example.com/projects/g/apache/commons-io", - "url-identifier": "g/apache/commons-io" - }, - "results-url": "https://lgtm.example.com/projects/g/yarnpkg/yarn/analysis/2e65208b2f1872634132566a1a0ce6392407297c/files" - }, - "properties": { - "commit-id": { - "description": "The commit identifier.\nThe commit identifier is included only if the same commit was successfully analyzed for all languages. A detailed breakdown of which commit was analyzed for each language is provided in the `languages` property.\n", - "example": "04d7a2300feec9bbcc48185e370e3b5d3ae4da9d", - "type": "string" - }, - "id": { - "description": "The analysis identifier.", - "example": "2e65208b2f1872634132566a1a0ce6392407297c", - "type": "string" - }, - "languages": { - "description": "Per-language information.", - "items": { - "$ref": "#/components/schemas/language-stats" - }, - "type": "array" - }, - "log-url": { - "description": "A page on LGTM to view the logs for this analysis.", - "example": "https://lgtm.example.com/projects/g/yarnpkg/yarn/logs/analysis/2e65208b2f1872634132566a1a0ce6392407297c", - "type": "string" - }, - "project": { - "$ref": "#/components/schemas/project" - }, - "results-url": { - "description": "A page on LGTM to view the results of this analysis.", - "example": "https://lgtm.example.com/projects/g/yarnpkg/yarn/analysis/2e65208b2f1872634132566a1a0ce6392407297c/files", - "type": "string" - } - }, - "type": "object" + "description": "The time the commit was analyzed.", + "format": "date-time", + "type": "string" } Value: - "" - Or value must be an object + "2000-01-23T04:56:07Z" + | Error at "/commit-date": unhandled value of type time.Time Schema: { - "example": { - "id": "b45e291e7033460949ec986153c5416d22157d3e", - "languages": [ - { - "alerts": [ - { - "fixed": 1, - "new": 0, - "query": { - "name": "Incomplete string escaping or encoding" - } - } - ], - "fixed": 1, - "language": "javascript", - "new": 0, - "status": "success", - "status-message": "1 fixed alert" - } - ], - "results-url": "https://lgtm.example.com/projects/g/yarnpkg/yarn/rev/pr-b45e291e7033460949ec986153c5416d22157d3e", - "status": "success", - "status-message": "Analysis succeeded" - }, - "properties": { - "id": { - "description": "The identifier for the review.", - "example": "b45e291e7033460949ec986153c5416d22157d3e", - "type": "string" - }, - "languages": { - "description": "Detailed information for each language analyzed.", - "items": { - "$ref": "#/components/schemas/codereview_languages" - }, - "type": "array" - }, - "results-url": { - "description": "A page on LGTM to view the status and results of this code review.", - "example": "https://lgtm.example.com/projects/g/yarnpkg/yarn/rev/pr-b45e291e7033460949ec986153c5416d22157d3e", - "type": "string" - }, - "status": { - "description": "The status of the code review.", - "enum": [ - "pending", - "failure", - "success" - ], - "example": "success", - "type": "string" - }, - "status-message": { - "description": "A summary of the current status of the code review.", - "example": "Analysis succeeded", - "type": "string" - } - }, - "type": "object" + "description": "The time of the commit.", + "format": "date-time", + "type": "string" } Value: - "" - Or value must be an object -Schema: - { - "example": { - "id": "b45e291e7033460949ec986153c5416d22157d3e", - "result-url": "https://lgtm.com/api/v1.0/query/b45e291e7033460949ec986153c5416d22157d3e", - "stats": { - "failed": 1, - "pending": 1, - "success-with-result": 3, - "success-without-result": 5, - "successful": 8 - } - }, - "properties": { - "id": { - "description": "The identifier for the QueryJob.", - "example": "b45e291e7033460949ec986153c5416d22157d3e", - "type": "string" - }, - "result-url": { - "description": "URL to view the result of the query job.", - "example": "https://lgtm.com/api/v1.0/query/b45e291e7033460949ec986153c5416d22157d3e", - "type": "string" - }, - "stats": { - "$ref": "#/components/schemas/queryjob_stats" - } - }, - "type": "object" - } - -Value: - "" + "2000-01-23T04:56:07Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/mailchimp_com_3_0_55_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/mailchimp_com_3_0_55_openapi_yaml__validate index 584178924..cc1bb4f1f 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/mailchimp_com_3_0_55_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/mailchimp_com_3_0_55_openapi_yaml__validate @@ -1,22 +1,13 @@ -invalid paths: invalid path /account-exports: invalid operation POST: invalid example: value must be an array +invalid paths: invalid path /: invalid operation GET: invalid example: unhandled value of type time.Time Schema: { - "description": "The stages of an account export to include.", - "example": "[\"audiences\", \"gallery_files\"]", - "items": { - "enum": [ - "audiences", - "campaigns", - "events", - "gallery_files", - "reports", - "templates" - ], - "type": "string" - }, - "title": "Include Stages", - "type": "array" + "description": "Date of first payment for monthly plans.", + "example": "2010-01-01T23:59:59Z", + "format": "date-time", + "readOnly": true, + "title": "First Payment", + "type": "string" } Value: - "[\"audiences\", \"gallery_files\"]" + "2010-01-01T23:59:59Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/medium_com_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/medium_com_1_0_openapi_yaml__validate index 4b3b11f4d..51b5c40fd 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/medium_com_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/medium_com_1_0_openapi_yaml__validate @@ -1 +1,9 @@ -invalid paths: operation GET /search/articles?query={query} must define exactly all path parameters (missing: [query]) +invalid paths: invalid path /article/{article_id}: invalid operation GET: invalid example: unhandled value of type time.Time +Schema: + { + "example": "2021-05-28T04:22:48Z", + "type": "string" + } + +Value: + "2021-05-28T04:22:48Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/meraki_com_0_0_0_streaming_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/meraki_com_0_0_0_streaming_openapi_yaml__validate index 69593e27b..bb53a2f81 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/meraki_com_0_0_0_streaming_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/meraki_com_0_0_0_streaming_openapi_yaml__validate @@ -1,30 +1,10 @@ -invalid paths: invalid path /networks/{networkId}/clients/{clientId}/policy: invalid operation PUT: invalid example: Error at "/devicePolicy": property "devicePolicy" is missing +invalid paths: invalid path /networks/{networkId}/cameras/{serial}/snapshot: invalid operation POST: invalid example: Error at "/timestamp": unhandled value of type time.Time Schema: { - "example": { - "groupPolicyId": "101", - "mac": "00:11:22:33:44:55", - "type": "Group policy" - }, - "properties": { - "devicePolicy": { - "description": "The policy to assign. Can be 'Whitelisted', 'Blocked', 'Normal' or 'Group policy'. Required.", - "type": "string" - }, - "groupPolicyId": { - "description": "[optional] If 'devicePolicy' is set to 'Group policy' this param is used to specify the group policy ID.", - "type": "string" - } - }, - "required": [ - "devicePolicy" - ], - "type": "object" + "description": "[optional] The snapshot will be taken from this time on the camera. The timestamp is expected to be in ISO 8601 format. If no timestamp is specified, we will assume current time.", + "format": "date-time", + "type": "string" } Value: - { - "groupPolicyId": "101", - "mac": "00:11:22:33:44:55", - "type": "Group policy" - } + "2021-04-30T15:18:08Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/meraki_com_1_32_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/meraki_com_1_32_0_openapi_yaml__validate new file mode 100644 index 000000000..be9688a9d --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/meraki_com_1_32_0_openapi_yaml__validate @@ -0,0 +1,10 @@ +invalid paths: invalid path /administered/identities/me: invalid operation GET: invalid example: example response: Error at "/lastUsedDashboardAt": unhandled value of type time.Time +Schema: + { + "description": "Last seen active on Dashboard UI", + "format": "date-time", + "type": "string" + } + +Value: + "2018-02-11T00:00:00.09021Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_1_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_1_1_openapi_yaml__validate new file mode 100644 index 000000000..d317e1a5f --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_1_1_openapi_yaml__validate @@ -0,0 +1,10 @@ +invalid paths: invalid path /{projectId}/image: invalid operation POST: invalid example: example Successful Prediction with Image request: Error at "/Created": unhandled value of type time.Time +Schema: + { + "format": "date-time", + "readOnly": true, + "type": "string" + } + +Value: + "2017-12-19T14:21:41.6789561Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_2_0_openapi_yaml__validate new file mode 100644 index 000000000..93a4029d1 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_2_0_openapi_yaml__validate @@ -0,0 +1,10 @@ +invalid paths: invalid path /{projectId}/image: invalid operation POST: invalid example: example Successful PredictImage request: Error at "/created": unhandled value of type time.Time +Schema: + { + "format": "date-time", + "readOnly": true, + "type": "string" + } + +Value: + "2017-12-19T14:21:41.6789561Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_3_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_3_0_openapi_yaml__validate index 4e74a92fc..b6e27ae1f 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_3_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_3_0_openapi_yaml__validate @@ -1 +1,11 @@ -invalid paths: invalid path /{projectId}/detect/iterations/{publishedName}/image: invalid operation POST: invalid example: example Successful DetectImage request: Error at "/id": string doesn't match the format "uuid": string doesn't match pattern "^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$" | Error at "/project": string doesn't match the format "uuid": string doesn't match pattern "^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$" +invalid paths: invalid path /{projectId}/classify/iterations/{publishedName}/image: invalid operation POST: invalid example: example Successful ClassifyImage request: Error at "/created": unhandled value of type time.Time +Schema: + { + "description": "Date this prediction was created.", + "format": "date-time", + "readOnly": true, + "type": "string" + } + +Value: + "2019-03-06T02:15:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_1_2_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_1_2_openapi_yaml__validate new file mode 100644 index 000000000..cea3fedca --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_1_2_openapi_yaml__validate @@ -0,0 +1,22 @@ +invalid paths: invalid path /projects: invalid operation GET: invalid example: example Successful GetProjects request: Error at "/0/Created": unhandled value of type time.Time +Schema: + { + "description": "Gets the date this project was created", + "format": "date-time", + "readOnly": true, + "type": "string" + } + +Value: + "2017-12-18T05:43:18.08Z" + | Error at "/0/LastModified": unhandled value of type time.Time +Schema: + { + "description": "Gets the date this project was last modified", + "format": "date-time", + "readOnly": true, + "type": "string" + } + +Value: + "2017-12-18T05:43:18.0962423Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_0_openapi_yaml__validate index 6711c89f6..82ba4d169 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_0_openapi_yaml__validate @@ -1,9 +1,22 @@ -invalid paths: invalid path /projects/{projectId}/images/tagged/count: invalid operation GET: invalid example: example Successful GetTaggedImageCount request: value must be an integer +invalid paths: invalid path /projects: invalid operation GET: invalid example: example Successful GetProjects request: Error at "/0/created": unhandled value of type time.Time Schema: { - "format": "int32", - "type": "integer" + "description": "Gets the date this project was created", + "format": "date-time", + "readOnly": true, + "type": "string" } Value: - "10" + "2017-12-18T05:43:18.08Z" + | Error at "/0/lastModified": unhandled value of type time.Time +Schema: + { + "description": "Gets the date this project was last modified", + "format": "date-time", + "readOnly": true, + "type": "string" + } + +Value: + "2017-12-18T05:43:18.0962423Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_1_openapi_yaml__validate index 6711c89f6..82ba4d169 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_1_openapi_yaml__validate @@ -1,9 +1,22 @@ -invalid paths: invalid path /projects/{projectId}/images/tagged/count: invalid operation GET: invalid example: example Successful GetTaggedImageCount request: value must be an integer +invalid paths: invalid path /projects: invalid operation GET: invalid example: example Successful GetProjects request: Error at "/0/created": unhandled value of type time.Time Schema: { - "format": "int32", - "type": "integer" + "description": "Gets the date this project was created", + "format": "date-time", + "readOnly": true, + "type": "string" } Value: - "10" + "2017-12-18T05:43:18.08Z" + | Error at "/0/lastModified": unhandled value of type time.Time +Schema: + { + "description": "Gets the date this project was last modified", + "format": "date-time", + "readOnly": true, + "type": "string" + } + +Value: + "2017-12-18T05:43:18.0962423Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_2_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_2_openapi_yaml__validate index 6711c89f6..d3ca13ce6 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_2_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_2_openapi_yaml__validate @@ -1,9 +1,22 @@ -invalid paths: invalid path /projects/{projectId}/images/tagged/count: invalid operation GET: invalid example: example Successful GetTaggedImageCount request: value must be an integer +invalid paths: invalid path /projects: invalid operation GET: invalid example: example Successful GetProjects request: Error at "/0/created": unhandled value of type time.Time Schema: { - "format": "int32", - "type": "integer" + "description": "Gets the date this project was created.", + "format": "date-time", + "readOnly": true, + "type": "string" } Value: - "10" + "2017-12-18T05:43:18.08Z" + | Error at "/0/lastModified": unhandled value of type time.Time +Schema: + { + "description": "Gets the date this project was last modified.", + "format": "date-time", + "readOnly": true, + "type": "string" + } + +Value: + "2017-12-18T05:43:18.0962423Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_0_openapi_yaml__validate index 336b8c100..c827cce4b 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_0_openapi_yaml__validate @@ -1 +1,22 @@ -invalid paths: invalid path /projects/{projectId}/images/regions: invalid operation DELETE: invalid example: Successful DeleteImageRegions request: Error at "/0": string doesn't match the format "uuid": string doesn't match pattern "^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$" +invalid paths: invalid path /projects: invalid operation GET: invalid example: example Successful GetProjects request: Error at "/0/created": unhandled value of type time.Time +Schema: + { + "description": "Gets the date this project was created.", + "format": "date-time", + "readOnly": true, + "type": "string" + } + +Value: + "2017-12-18T05:43:18Z" + | Error at "/0/lastModified": unhandled value of type time.Time +Schema: + { + "description": "Gets the date this project was last modified.", + "format": "date-time", + "readOnly": true, + "type": "string" + } + +Value: + "2017-12-18T05:43:18Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_1_openapi_yaml__validate index 336b8c100..c827cce4b 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_1_openapi_yaml__validate @@ -1 +1,22 @@ -invalid paths: invalid path /projects/{projectId}/images/regions: invalid operation DELETE: invalid example: Successful DeleteImageRegions request: Error at "/0": string doesn't match the format "uuid": string doesn't match pattern "^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$" +invalid paths: invalid path /projects: invalid operation GET: invalid example: example Successful GetProjects request: Error at "/0/created": unhandled value of type time.Time +Schema: + { + "description": "Gets the date this project was created.", + "format": "date-time", + "readOnly": true, + "type": "string" + } + +Value: + "2017-12-18T05:43:18Z" + | Error at "/0/lastModified": unhandled value of type time.Time +Schema: + { + "description": "Gets the date this project was last modified.", + "format": "date-time", + "readOnly": true, + "type": "string" + } + +Value: + "2017-12-18T05:43:18Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_2_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_2_openapi_yaml__validate index 336b8c100..c827cce4b 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_2_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_2_openapi_yaml__validate @@ -1 +1,22 @@ -invalid paths: invalid path /projects/{projectId}/images/regions: invalid operation DELETE: invalid example: Successful DeleteImageRegions request: Error at "/0": string doesn't match the format "uuid": string doesn't match pattern "^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$" +invalid paths: invalid path /projects: invalid operation GET: invalid example: example Successful GetProjects request: Error at "/0/created": unhandled value of type time.Time +Schema: + { + "description": "Gets the date this project was created.", + "format": "date-time", + "readOnly": true, + "type": "string" + } + +Value: + "2017-12-18T05:43:18Z" + | Error at "/0/lastModified": unhandled value of type time.Time +Schema: + { + "description": "Gets the date this project was last modified.", + "format": "date-time", + "readOnly": true, + "type": "string" + } + +Value: + "2017-12-18T05:43:18Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/mux_com_v1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/mux_com_v1_openapi_yaml__validate new file mode 100644 index 000000000..4f508d87d --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/mux_com_v1_openapi_yaml__validate @@ -0,0 +1,9 @@ +invalid paths: invalid path /data/v1/errors: invalid operation GET: invalid example: Error at "/data/0/last_seen": unhandled value of type time.Time +Schema: + { + "description": "The last time this error was seen (ISO 8601 timestamp).", + "type": "string" + } + +Value: + "2021-01-08T13:42:39Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/neutrinoapi_net_3_6_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/neutrinoapi_net_3_6_4_openapi_yaml__validate new file mode 100644 index 000000000..b1348778f --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/neutrinoapi_net_3_6_4_openapi_yaml__validate @@ -0,0 +1,10 @@ +invalid components: schema "GeocodeAddressResponse": invalid example: unhandled value of type time.Time +Schema: + { + "description": "The current date at the time zone (ISO 8601 format 'YYYY-MM-DD')", + "example": "2021-01-01T00:00:00Z", + "type": "string" + } + +Value: + "2021-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversation_2_0_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversation_2_0_1_openapi_yaml__validate index f1ea5e49d..b05119197 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversation_2_0_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversation_2_0_1_openapi_yaml__validate @@ -1,10 +1,10 @@ -invalid paths: invalid path /conversations: invalid operation GET: invalid example: value must be a number +invalid components: schema "event_retrieved": invalid example: unhandled value of type time.Time Schema: { - "description": "The total number of records returned by your request.", - "example": "100", - "type": "number" + "description": "Time of creation", + "example": "2020-01-01T14:00:00Z", + "type": "string" } Value: - "100" + "2020-01-01T14:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversation_v2_1_0_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversation_v2_1_0_1_openapi_yaml__validate index a393008ff..61c2e6135 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversation_v2_1_0_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversation_v2_1_0_1_openapi_yaml__validate @@ -1,8 +1,10 @@ -invalid components: parameter "end_id_parameter": invalid example: value must be a string +invalid components: schema "all_events": invalid anyOf element: invalid allOf element: invalid example: unhandled value of type time.Time Schema: { + "description": "The time that the event happened", + "example": "2019-09-12T19:49:21.823Z", "type": "string" } Value: - 19 + "2019-09-12T19:49:21.823Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversion_1_0_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversion_1_0_1_openapi_yaml__validate new file mode 100644 index 000000000..870643a5e --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversion_1_0_1_openapi_yaml__validate @@ -0,0 +1,8 @@ +invalid components: parameter "timestamp": invalid example: unhandled value of type time.Time +Schema: + { + "type": "string" + } + +Value: + "2020-01-01T12:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_dispatch_0_3_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_dispatch_0_3_4_openapi_yaml__validate index 89d653ec6..d3b294fb6 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_dispatch_0_3_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_dispatch_0_3_4_openapi_yaml__validate @@ -1,16 +1,11 @@ -invalid components: schema "finalReport": invalid example: value is not one of the allowed values ["messenger","viber_sevice_msg","sms","whatsapp","mms"] +invalid components: schema "MessageStatus": invalid example: unhandled value of type time.Time Schema: { - "enum": [ - "messenger", - "viber_sevice_msg", - "sms", - "whatsapp", - "mms" - ], - "example": "viber_service_msg", + "description": "The datetime of when the event occurred.", + "example": "2020-01-01T14:00:00Z", + "format": "ISO 8601", "type": "string" } Value: - "viber_service_msg" + "2020-01-01T14:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_media_1_0_2_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_media_1_0_2_openapi_yaml__validate new file mode 100644 index 000000000..77e09bd8a --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_media_1_0_2_openapi_yaml__validate @@ -0,0 +1,10 @@ +invalid components: schema "Media": invalid example: unhandled value of type time.Time +Schema: + { + "description": "A timestamp for the time that the file was created", + "example": "2020-01-01T14:00:00Z", + "type": "string" + } + +Value: + "2020-01-01T14:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_messages_olympus_1_4_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_messages_olympus_1_4_0_openapi_yaml__validate index a448898c1..6ccf0ff9f 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_messages_olympus_1_4_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_messages_olympus_1_4_0_openapi_yaml__validate @@ -1,10 +1,10 @@ -invalid components: schema "messageStatusBase": invalid example: value must be a string +invalid components: schema "InboundMessengerMessageCommon": invalid example: unhandled value of type time.Time Schema: { - "description": "The error code encountered when sending the message. See [our errors list](https://developer.nexmo.com/api-errors/messages-olympus) for a list of possible errors", - "example": 1000, + "description": "The datetime of when the event occurred, in `ISO 8601` format.", + "example": "2020-01-01T14:00:00Z", "type": "string" } Value: - 1000 + "2020-01-01T14:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_reports_2_2_2_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_reports_2_2_2_openapi_yaml__validate index 7f0e5d68d..5133f6c22 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_reports_2_2_2_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_reports_2_2_2_openapi_yaml__validate @@ -1 +1,11 @@ -invalid components: schema "ASR": invalid allOf element: invalid example: string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" +invalid components: schema "ASR": invalid allOf element: invalid example: unhandled value of type time.Time +Schema: + { + "description": "ISO-8601 extended time zone offset or ISO-8601 UTC zone offset formatted date (format `yyyy-mm-ddThh:mm:ss[.sss]±hh:mm` or `yyyy-mm-ddThh:mm:ss[.sss]Z`) for when report should end. It is exclusive, i.e. the provided value is strictly greater than the value in the field `date_received` in the CDR. \u003cbr\u003eIf unspecified, defaults to the current time.\n", + "example": "2018-01-01T00:00:00Z", + "format": "date", + "type": "string" + } + +Value: + "2018-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_sms_1_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_sms_1_2_0_openapi_yaml__validate new file mode 100644 index 000000000..d93718a10 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_sms_1_2_0_openapi_yaml__validate @@ -0,0 +1,10 @@ +invalid components: schema "DeliveryReceipt": invalid example: unhandled value of type time.Time +Schema: + { + "description": "The time when Vonage started to push this Delivery Receipt to your webhook endpoint.", + "example": "2020-01-01T12:00:00Z", + "type": "string" + } + +Value: + "2020-01-01T12:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_subaccounts_1_0_8_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_subaccounts_1_0_8_openapi_yaml__validate index 05421f91b..12ff39773 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_subaccounts_1_0_8_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_subaccounts_1_0_8_openapi_yaml__validate @@ -1,9 +1,10 @@ -invalid components: schema "TransferBalanceOrCreditRequest": invalid example: value must be a number +invalid components: schema "ListBalanceTransfersResponse": invalid example: unhandled value of type time.Time Schema: { - "example": "123.45", - "type": "number" + "description": "The date and time when the balance transfer was executed", + "example": "2019-03-02T16:34:49Z", + "type": "string" } Value: - "123.45" + "2019-03-02T16:34:49Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/notion_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/notion_com_1_0_0_openapi_yaml__validate index 90e10a40b..044e497a0 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/notion_com_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/notion_com_1_0_0_openapi_yaml__validate @@ -1 +1,9 @@ -invalid paths: invalid path /v1/pages/{id}: invalid operation GET: parameter name can't be blank +invalid paths: invalid path /v1/blocks/{id}: invalid operation DELETE: invalid example: unhandled value of type time.Time +Schema: + { + "example": "2021-08-06T17:46:00Z", + "type": "string" + } + +Value: + "2021-08-06T17:46:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/nowpayments_io_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nowpayments_io_1_0_0_openapi_yaml__validate new file mode 100644 index 000000000..d3b3c3817 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/nowpayments_io_1_0_0_openapi_yaml__validate @@ -0,0 +1,9 @@ +invalid paths: invalid path /v1/payment/: invalid operation GET: parameter "dateFrom" schema is invalid: invalid example: unhandled value of type time.Time +Schema: + { + "example": "2020-01-01T00:00:00Z", + "type": "string" + } + +Value: + "2020-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/ntropy_network_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/ntropy_network_1_0_0_openapi_yaml__validate new file mode 100644 index 000000000..3956eec54 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/ntropy_network_1_0_0_openapi_yaml__validate @@ -0,0 +1,9 @@ +invalid paths: invalid path /classifier/business/batch/{id}: invalid operation GET: invalid example: unhandled value of type time.Time +Schema: + { + "example": "1949-08-24T23:09:35.824Z", + "type": "string" + } + +Value: + "1949-08-24T23:09:35.824Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/nytimes_com_books_api_3_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nytimes_com_books_api_3_0_0_openapi_yaml__validate new file mode 100644 index 000000000..c308c3aeb --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/nytimes_com_books_api_3_0_0_openapi_yaml__validate @@ -0,0 +1,24 @@ +invalid paths: invalid path /lists.{format}: invalid operation GET: invalid example: example response: Error at "/last_modified": unhandled value of type time.Time +Schema: + { + "type": "string" + } + +Value: + "2016-03-11T13:09:01-05:00" + | Error at "/results/0/bestsellers_date": unhandled value of type time.Time +Schema: + { + "type": "string" + } + +Value: + "2016-03-05T00:00:00Z" + | Error at "/results/0/published_date": unhandled value of type time.Time +Schema: + { + "type": "string" + } + +Value: + "2016-03-20T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/openaq_local_2_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/openaq_local_2_0_0_openapi_yaml__validate new file mode 100644 index 000000000..0d6891a0a --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/openaq_local_2_0_0_openapi_yaml__validate @@ -0,0 +1,19 @@ +invalid paths: invalid path /v1/measurements: invalid operation GET: parameter "date_from" schema is invalid: invalid default: doesn't match any schema from "anyOf" +Schema: + { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "format": "date", + "type": "string" + } + ], + "default": "2000-01-01T00:00:00Z", + "title": "Date From" + } + +Value: + "2000-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/openstates_org_2021_11_12_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/openstates_org_2021_11_12_openapi_yaml__validate new file mode 100644 index 000000000..651eb1156 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/openstates_org_2021_11_12_openapi_yaml__validate @@ -0,0 +1,10 @@ +invalid components: schema "Bill": invalid example: unhandled value of type time.Time +Schema: + { + "example": "2020-03-14T00:00:00Z", + "title": "Date", + "type": "string" + } + +Value: + "2020-03-14T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/openuv_io_v1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/openuv_io_v1_openapi_yaml__validate index af99cc291..e8b65aed5 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/openuv_io_v1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/openuv_io_v1_openapi_yaml__validate @@ -1 +1,11 @@ -invalid paths: invalid path /protection: invalid operation GET: extra sibling fields: [type] +invalid paths: invalid path /forecast: invalid operation GET: parameter "dt" schema is invalid: invalid example: unhandled value of type time.Time +Schema: + { + "description": "UTC datetime in ISO-8601 format, now by default. Use that parameter to get UV Index Forecast for any point in time.", + "example": "2018-02-04T04:39:06.467Z", + "format": "date-time", + "type": "string" + } + +Value: + "2018-02-04T04:39:06.467Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/pandascore_co_2_23_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/pandascore_co_2_23_1_openapi_yaml__validate index a3b23feea..2af8c6459 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/pandascore_co_2_23_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/pandascore_co_2_23_1_openapi_yaml__validate @@ -1,4 +1,14 @@ -invalid components: response "AdditionIncidents": invalid example: example /additions?page[size]=1: Error at "/0": doesn't match schema due to: Error at "/object": property "begin_at" is unsupported +invalid components: response "AdditionIncidents": invalid example: example /additions?page[size]=1: Error at "/0": doesn't match schema due to: Error at "/modified_at": unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-22T23:45:50Z" + | Error at "/object": property "begin_at" is unsupported Schema: { "additionalProperties": false, @@ -3154,6 +3164,16 @@ Value: "winner": null, "winner_id": null } + | Error at "/object/modified_at": unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-22T23:45:50Z" | Error at "/object": property "number_of_games" is unsupported Schema: { @@ -9164,7 +9184,35 @@ Schema: Value: "match" - Or Error at "/object/end_at": doesn't match schema due to: Value is not nullable + Or Error at "/modified_at": unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-22T23:45:50Z" + | Error at "/object/begin_at": doesn't match schema due to: unhandled value of type time.Time +Schema: + { + "nullable": true + } + +Value: + "2021-04-24T16:00:00Z" + And unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-24T16:00:00Z" + | Error at "/object/end_at": doesn't match schema due to: Value is not nullable Schema: { "format": "date-time", @@ -9574,6 +9622,16 @@ Schema: Value: null + | Error at "/object/league/modified_at": unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-22T10:15:12Z" | Error at "/object/league/url": doesn't match schema due to: Value is not nullable Schema: { @@ -9602,6 +9660,70 @@ Schema: Value: null + | Error at "/object/modified_at": unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-22T23:45:50Z" + | Error at "/object/original_scheduled_at": doesn't match schema due to: unhandled value of type time.Time +Schema: + { + "nullable": true + } + +Value: + "2021-04-24T16:00:00Z" + And unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-24T16:00:00Z" + | Error at "/object/scheduled_at": doesn't match schema due to: unhandled value of type time.Time +Schema: + { + "nullable": true + } + +Value: + "2021-04-24T16:00:00Z" + And unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-24T16:00:00Z" + | Error at "/object/serie/begin_at": doesn't match schema due to: unhandled value of type time.Time +Schema: + { + "nullable": true + } + +Value: + "2021-04-12T10:00:00Z" + And unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-12T10:00:00Z" | Error at "/object/serie/description": doesn't match schema due to: Value is not nullable Schema: { @@ -9620,6 +9742,16 @@ Schema: Value: null + | Error at "/object/serie/modified_at": unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-12T07:20:33Z" | Error at "/object/serie/name": doesn't match schema due to: Value is not nullable Schema: { @@ -9663,6 +9795,52 @@ Schema: Value: null + | Error at "/object/tournament/begin_at": doesn't match schema due to: unhandled value of type time.Time +Schema: + { + "nullable": true + } + +Value: + "2021-04-19T10:00:00Z" + And unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-19T10:00:00Z" + | Error at "/object/tournament/end_at": doesn't match schema due to: unhandled value of type time.Time +Schema: + { + "nullable": true + } + +Value: + "2021-04-24T22:00:00Z" + And unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-24T22:00:00Z" + | Error at "/object/tournament/modified_at": unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-22T13:14:31Z" | Error at "/object/tournament/winner_id": doesn't match schema due to: doesn't match any schema from "anyOf" Schema: { @@ -9916,7 +10094,17 @@ Schema: Value: null - Or Error at "/object": property "begin_at" is unsupported + Or Error at "/modified_at": unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-22T23:45:50Z" + | Error at "/object": property "begin_at" is unsupported Schema: { "additionalProperties": false, @@ -23693,7 +23881,35 @@ Schema: Value: "match" - Or Error at "/object": property "detailed_stats" is unsupported + Or Error at "/modified_at": unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-22T23:45:50Z" + | Error at "/object/begin_at": doesn't match schema due to: unhandled value of type time.Time +Schema: + { + "nullable": true + } + +Value: + "2021-04-24T16:00:00Z" + And unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-24T16:00:00Z" + | Error at "/object": property "detailed_stats" is unsupported Schema: { "additionalProperties": false, @@ -25503,6 +25719,16 @@ Value: "winner": null, "winner_id": null } + | Error at "/object/league/modified_at": unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-22T10:15:12Z" | Error at "/object/league/url": doesn't match schema due to: Value is not nullable Schema: { @@ -26592,6 +26818,16 @@ Value: "winner": null, "winner_id": null } + | Error at "/object/modified_at": unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-22T23:45:50Z" | Error at "/object": property "number_of_games" is unsupported Schema: { @@ -35257,7 +35493,17 @@ Schema: Value: "match" - Or Error at "/object": property "begin_at" is unsupported + Or Error at "/modified_at": unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-22T23:45:50Z" + | Error at "/object": property "begin_at" is unsupported Schema: { "additionalProperties": false, @@ -38749,6 +38995,16 @@ Value: "winner": null, "winner_id": null } + | Error at "/object/modified_at": unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-22T23:45:50Z" | Error at "/object": property "number_of_games" is unsupported Schema: { @@ -45452,7 +45708,35 @@ Schema: Value: "match" - Or Error at "/object": property "detailed_stats" is unsupported + Or Error at "/modified_at": unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-22T23:45:50Z" + | Error at "/object/begin_at": doesn't match schema due to: unhandled value of type time.Time +Schema: + { + "nullable": true + } + +Value: + "2021-04-24T16:00:00Z" + And unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-24T16:00:00Z" + | Error at "/object": property "detailed_stats" is unsupported Schema: { "additionalProperties": false, @@ -47097,6 +47381,16 @@ Value: "winner": null, "winner_id": null } + | Error at "/object/league/modified_at": unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-22T10:15:12Z" | Error at "/object/league/url": doesn't match schema due to: Value is not nullable Schema: { @@ -48087,6 +48381,16 @@ Value: "winner": null, "winner_id": null } + | Error at "/object/modified_at": unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-22T23:45:50Z" | Error at "/object": property "number_of_games" is unsupported Schema: { @@ -50376,6 +50680,24 @@ Value: "winner": null, "winner_id": null } + | Error at "/object/serie/begin_at": doesn't match schema due to: unhandled value of type time.Time +Schema: + { + "nullable": true + } + +Value: + "2021-04-12T10:00:00Z" + And unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-12T10:00:00Z" | Error at "/object/serie/description": doesn't match schema due to: Value is not nullable Schema: { @@ -50394,6 +50716,16 @@ Schema: Value: null + | Error at "/object/serie/modified_at": unhandled value of type time.Time +Schema: + { + "format": "date-time", + "minLength": 1, + "type": "string" + } + +Value: + "2021-04-12T07:20:33Z" | Error at "/object/serie/name": doesn't match schema due to: Value is not nullable Schema: { diff --git a/openapi3/testdata/apis_guru_openapi_directory/pay1_de_link_v1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/pay1_de_link_v1_openapi_yaml__validate index 89e5fff52..2b3b741e6 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/pay1_de_link_v1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/pay1_de_link_v1_openapi_yaml__validate @@ -1 +1,11 @@ -invalid components: security scheme "createAuth": security scheme of type 'http' has invalid 'scheme' value "payone-hmac-sha256" +invalid components: schema "CartItemDto": invalid example: unhandled value of type time.Time +Schema: + { + "description": "delivery period end date", + "example": "2021-01-01T00:00:00Z", + "format": "date", + "type": "string" + } + +Value: + "2021-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/pdfgeneratorapi_com_3_1_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/pdfgeneratorapi_com_3_1_1_openapi_yaml__validate index 678cfcb2d..8554abe99 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/pdfgeneratorapi_com_3_1_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/pdfgeneratorapi_com_3_1_1_openapi_yaml__validate @@ -1,13 +1,10 @@ -invalid components: response "error403": invalid example: value is not one of the allowed values ["Your account has exceeded the monthly document generation limit."] +invalid components: schema "Template": invalid example: unhandled value of type time.Time Schema: { - "description": "Error description", - "enum": [ - "Your account has exceeded the monthly document generation limit." - ], - "example": "Access not granted", + "description": "Timestamp when the template was modified", + "example": "2017-10-21T11:49:28Z", "type": "string" } Value: - "Access not granted" + "2017-10-21T11:49:28Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/personio_de_personnel_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/personio_de_personnel_1_0_openapi_yaml__validate index 63e5f7d6b..7b6a8e3e5 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/personio_de_personnel_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/personio_de_personnel_1_0_openapi_yaml__validate @@ -9,3 +9,23 @@ Value: { "$ref": "#/components/schemas/UpdateAttendancePeriodRequest/example/comment" } + | Error at "/attendances/0/date": unhandled value of type time.Time +Schema: + { + "description": "Attendance date as YYYY-MM-DD", + "format": "date", + "type": "string" + } + +Value: + "2017-01-18T00:00:00Z" + | Error at "/attendances/1/date": unhandled value of type time.Time +Schema: + { + "description": "Attendance date as YYYY-MM-DD", + "format": "date", + "type": "string" + } + +Value: + "2017-01-17T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/phantauth_net_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/phantauth_net_1_0_0_openapi_yaml__validate new file mode 100644 index 000000000..acdaa653f --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/phantauth_net_1_0_0_openapi_yaml__validate @@ -0,0 +1,9 @@ +invalid paths: invalid path /user: invalid operation POST: invalid example: Error at "/birthdate": unhandled value of type time.Time +Schema: + { + "description": "The user's birthday, represented as an ISO 8601:2004 [ISO8601‑2004] YYYY-MM-DD format.", + "type": "string" + } + +Value: + "1950-02-10T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/plaid_com_2020_09_14_1_345_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/plaid_com_2020_09_14_1_345_1_openapi_yaml__validate index e9ec8ef81..585168e23 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/plaid_com_2020_09_14_1_345_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/plaid_com_2020_09_14_1_345_1_openapi_yaml__validate @@ -1,314 +1,11 @@ -invalid paths: invalid path /asset_report/get: invalid operation POST: invalid example: example example-1: Error at "/report/items/0/accounts/0": doesn't match schema due to: Error at "/balances/limit": property "limit" is missing +invalid components: schema "Activity": invalid example: unhandled value of type time.Time Schema: { - "additionalProperties": true, - "description": "A set of fields describing the balance for an account. Balance information may be cached unless the balance object was returned by `/accounts/balance/get`.", - "properties": { - "available": { - "description": "The amount of funds available to be withdrawn from the account, as determined by the financial institution.\n\nFor `credit`-type accounts, the `available` balance typically equals the `limit` less the `current` balance, less any pending outflows plus any pending inflows.\n\nFor `depository`-type accounts, the `available` balance typically equals the `current` balance less any pending outflows plus any pending inflows. For `depository`-type accounts, the `available` balance does not include the overdraft limit.\n\nFor `investment`-type accounts (or `brokerage`-type accounts for API versions 2018-05-22 and earlier), the `available` balance is the total cash available to withdraw as presented by the institution.\n\nNote that not all institutions calculate the `available` balance. In the event that `available` balance is unavailable, Plaid will return an `available` balance value of `null`.\n\nAvailable balance may be cached and is not guaranteed to be up-to-date in realtime unless the value was returned by `/accounts/balance/get`.\n\nIf `current` is `null` this field is guaranteed not to be `null`.", - "format": "double", - "nullable": true, - "type": "number" - }, - "current": { - "description": "The total amount of funds in or owed by the account.\n\nFor `credit`-type accounts, a positive balance indicates the amount owed; a negative amount indicates the lender owing the account holder.\n\nFor `loan`-type accounts, the current balance is the principal remaining on the loan, except in the case of student loan accounts at Sallie Mae (`ins_116944`). For Sallie Mae student loans, the account's balance includes both principal and any outstanding interest.\n\nFor `investment`-type accounts (or `brokerage`-type accounts for API versions 2018-05-22 and earlier), the current balance is the total value of assets as presented by the institution.\n\nNote that balance information may be cached unless the value was returned by `/accounts/balance/get`; if the Item is enabled for Transactions, the balance will be at least as recent as the most recent Transaction update. If you require realtime balance information, use the `available` balance as provided by `/accounts/balance/get`.\n\nWhen returned by `/accounts/balance/get`, this field may be `null`. When this happens, `available` is guaranteed not to be `null`.", - "format": "double", - "nullable": true, - "type": "number" - }, - "iso_currency_code": { - "description": "The ISO-4217 currency code of the balance. Always null if `unofficial_currency_code` is non-null.", - "nullable": true, - "type": "string" - }, - "last_updated_datetime": { - "description": "Timestamp in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:mm:ssZ`) indicating the last time that the balance for the given account has been updated\n\nThis is currently only provided when the `min_last_updated_datetime` is passed when calling `/accounts/balance/get` for `ins_128026` (Capital One).", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "limit": { - "description": "For `credit`-type accounts, this represents the credit limit.\n\nFor `depository`-type accounts, this represents the pre-arranged overdraft limit, which is common for current (checking) accounts in Europe.\n\nIn North America, this field is typically only available for `credit`-type accounts.", - "format": "double", - "nullable": true, - "type": "number" - }, - "unofficial_currency_code": { - "description": "The unofficial currency code associated with the balance. Always null if `iso_currency_code` is non-null. Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries.\n\nSee the [currency code schema](https://plaid.com/docs/api/accounts#currency-code-schema) for a full listing of supported `unofficial_currency_code`s.", - "nullable": true, - "type": "string" - } - }, - "required": [ - "available", - "current", - "limit", - "iso_currency_code", - "unofficial_currency_code" - ], - "title": "AccountBalance", - "type": "object" + "description": "The date and time this activity was initiated [ISO 8601](https://wikipedia.org/wiki/ISO_8601) (YYYY-MM-DD) format in UTC.", + "example": "2020-01-01T00:00:00Z", + "format": "datetime", + "type": "string" } Value: - { - "available": 43200, - "current": 43200, - "iso_currency_code": "USD", - "unofficial_currency_code": null - } - And Error at "/owners/0/addresses/0/data/country": property "country" is missing -Schema: - { - "additionalProperties": true, - "description": "Data about the components comprising an address.", - "properties": { - "city": { - "description": "The full city name", - "nullable": true, - "type": "string" - }, - "country": { - "description": "The ISO 3166-1 alpha-2 country code", - "nullable": true, - "type": "string" - }, - "postal_code": { - "description": "The postal code. In API versions 2018-05-22 and earlier, this field is called `zip`.", - "nullable": true, - "type": "string" - }, - "region": { - "description": "The region or state. In API versions 2018-05-22 and earlier, this field is called `state`.\nExample: `\"NC\"`", - "nullable": true, - "type": "string" - }, - "street": { - "description": "The full street address\nExample: `\"564 Main Street, APT 15\"`", - "type": "string" - } - }, - "required": [ - "city", - "region", - "street", - "postal_code", - "country" - ], - "title": "AddressData", - "type": "object" - } - -Value: - { - "city": "Malakoff", - "postal_code": "14236", - "region": "NY", - "street": "2992 Cameron Road" - } - | Error at "/owners/0/addresses/1/data/country": property "country" is missing -Schema: - { - "additionalProperties": true, - "description": "Data about the components comprising an address.", - "properties": { - "city": { - "description": "The full city name", - "nullable": true, - "type": "string" - }, - "country": { - "description": "The ISO 3166-1 alpha-2 country code", - "nullable": true, - "type": "string" - }, - "postal_code": { - "description": "The postal code. In API versions 2018-05-22 and earlier, this field is called `zip`.", - "nullable": true, - "type": "string" - }, - "region": { - "description": "The region or state. In API versions 2018-05-22 and earlier, this field is called `state`.\nExample: `\"NC\"`", - "nullable": true, - "type": "string" - }, - "street": { - "description": "The full street address\nExample: `\"564 Main Street, APT 15\"`", - "type": "string" - } - }, - "required": [ - "city", - "region", - "street", - "postal_code", - "country" - ], - "title": "AddressData", - "type": "object" - } - -Value: - { - "city": "San Matias", - "postal_code": "93405-2255", - "region": "CA", - "street": "2493 Leisure Lane" - } - | Error at "/report/items/0/accounts/1": doesn't match schema due to: Error at "/balances/limit": property "limit" is missing -Schema: - { - "additionalProperties": true, - "description": "A set of fields describing the balance for an account. Balance information may be cached unless the balance object was returned by `/accounts/balance/get`.", - "properties": { - "available": { - "description": "The amount of funds available to be withdrawn from the account, as determined by the financial institution.\n\nFor `credit`-type accounts, the `available` balance typically equals the `limit` less the `current` balance, less any pending outflows plus any pending inflows.\n\nFor `depository`-type accounts, the `available` balance typically equals the `current` balance less any pending outflows plus any pending inflows. For `depository`-type accounts, the `available` balance does not include the overdraft limit.\n\nFor `investment`-type accounts (or `brokerage`-type accounts for API versions 2018-05-22 and earlier), the `available` balance is the total cash available to withdraw as presented by the institution.\n\nNote that not all institutions calculate the `available` balance. In the event that `available` balance is unavailable, Plaid will return an `available` balance value of `null`.\n\nAvailable balance may be cached and is not guaranteed to be up-to-date in realtime unless the value was returned by `/accounts/balance/get`.\n\nIf `current` is `null` this field is guaranteed not to be `null`.", - "format": "double", - "nullable": true, - "type": "number" - }, - "current": { - "description": "The total amount of funds in or owed by the account.\n\nFor `credit`-type accounts, a positive balance indicates the amount owed; a negative amount indicates the lender owing the account holder.\n\nFor `loan`-type accounts, the current balance is the principal remaining on the loan, except in the case of student loan accounts at Sallie Mae (`ins_116944`). For Sallie Mae student loans, the account's balance includes both principal and any outstanding interest.\n\nFor `investment`-type accounts (or `brokerage`-type accounts for API versions 2018-05-22 and earlier), the current balance is the total value of assets as presented by the institution.\n\nNote that balance information may be cached unless the value was returned by `/accounts/balance/get`; if the Item is enabled for Transactions, the balance will be at least as recent as the most recent Transaction update. If you require realtime balance information, use the `available` balance as provided by `/accounts/balance/get`.\n\nWhen returned by `/accounts/balance/get`, this field may be `null`. When this happens, `available` is guaranteed not to be `null`.", - "format": "double", - "nullable": true, - "type": "number" - }, - "iso_currency_code": { - "description": "The ISO-4217 currency code of the balance. Always null if `unofficial_currency_code` is non-null.", - "nullable": true, - "type": "string" - }, - "last_updated_datetime": { - "description": "Timestamp in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:mm:ssZ`) indicating the last time that the balance for the given account has been updated\n\nThis is currently only provided when the `min_last_updated_datetime` is passed when calling `/accounts/balance/get` for `ins_128026` (Capital One).", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "limit": { - "description": "For `credit`-type accounts, this represents the credit limit.\n\nFor `depository`-type accounts, this represents the pre-arranged overdraft limit, which is common for current (checking) accounts in Europe.\n\nIn North America, this field is typically only available for `credit`-type accounts.", - "format": "double", - "nullable": true, - "type": "number" - }, - "unofficial_currency_code": { - "description": "The unofficial currency code associated with the balance. Always null if `iso_currency_code` is non-null. Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries.\n\nSee the [currency code schema](https://plaid.com/docs/api/accounts#currency-code-schema) for a full listing of supported `unofficial_currency_code`s.", - "nullable": true, - "type": "string" - } - }, - "required": [ - "available", - "current", - "limit", - "iso_currency_code", - "unofficial_currency_code" - ], - "title": "AccountBalance", - "type": "object" - } - -Value: - { - "available": 100, - "current": 110, - "iso_currency_code": "USD", - "unofficial_currency_code": null - } - And Error at "/owners/0/addresses/0/data/country": property "country" is missing -Schema: - { - "additionalProperties": true, - "description": "Data about the components comprising an address.", - "properties": { - "city": { - "description": "The full city name", - "nullable": true, - "type": "string" - }, - "country": { - "description": "The ISO 3166-1 alpha-2 country code", - "nullable": true, - "type": "string" - }, - "postal_code": { - "description": "The postal code. In API versions 2018-05-22 and earlier, this field is called `zip`.", - "nullable": true, - "type": "string" - }, - "region": { - "description": "The region or state. In API versions 2018-05-22 and earlier, this field is called `state`.\nExample: `\"NC\"`", - "nullable": true, - "type": "string" - }, - "street": { - "description": "The full street address\nExample: `\"564 Main Street, APT 15\"`", - "type": "string" - } - }, - "required": [ - "city", - "region", - "street", - "postal_code", - "country" - ], - "title": "AddressData", - "type": "object" - } - -Value: - { - "city": "Malakoff", - "postal_code": "14236", - "region": "NY", - "street": "2992 Cameron Road" - } - | Error at "/owners/0/addresses/1/data/country": property "country" is missing -Schema: - { - "additionalProperties": true, - "description": "Data about the components comprising an address.", - "properties": { - "city": { - "description": "The full city name", - "nullable": true, - "type": "string" - }, - "country": { - "description": "The ISO 3166-1 alpha-2 country code", - "nullable": true, - "type": "string" - }, - "postal_code": { - "description": "The postal code. In API versions 2018-05-22 and earlier, this field is called `zip`.", - "nullable": true, - "type": "string" - }, - "region": { - "description": "The region or state. In API versions 2018-05-22 and earlier, this field is called `state`.\nExample: `\"NC\"`", - "nullable": true, - "type": "string" - }, - "street": { - "description": "The full street address\nExample: `\"564 Main Street, APT 15\"`", - "type": "string" - } - }, - "required": [ - "city", - "region", - "street", - "postal_code", - "country" - ], - "title": "AddressData", - "type": "object" - } - -Value: - { - "city": "San Matias", - "postal_code": "93405-2255", - "region": "CA", - "street": "2493 Leisure Lane" - } + "2020-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/pocketsmith_com_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/pocketsmith_com_2_0_openapi_yaml__validate index a930b8678..53a28d8b2 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/pocketsmith_com_2_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/pocketsmith_com_2_0_openapi_yaml__validate @@ -1,8 +1,10 @@ -invalid paths: invalid path /users/{id}/trend_analysis: invalid operation GET: invalid example: value must be an integer +invalid components: schema "Account": invalid example: unhandled value of type time.Time Schema: { - "type": "integer" + "description": "When the account was created.", + "example": "2018-02-27T00:00:00Z", + "type": "string" } Value: - true + "2018-02-27T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/pressassociation_io_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/pressassociation_io_2_0_openapi_yaml__validate index e1c4a8499..6fc4bdd6c 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/pressassociation_io_2_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/pressassociation_io_2_0_openapi_yaml__validate @@ -1,10 +1,10 @@ -invalid paths: invalid path /asset: invalid operation GET: parameter "updatedAfter" schema is invalid: invalid default: string doesn't match the regular expression "date-time" +invalid paths: invalid path /asset: invalid operation GET: parameter "updatedAfter" schema is invalid: invalid default: unhandled value of type time.Time Schema: { - "default": "2015-05-05T00:00:00.000Z", + "default": "2015-05-05T00:00:00Z", "pattern": "date-time", "type": "string" } Value: - "2015-05-05T00:00:00.000Z" + "2015-05-05T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/probely_com_1_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/probely_com_1_2_0_openapi_yaml__validate index 6242d574c..ae814e57c 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/probely_com_1_2_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/probely_com_1_2_0_openapi_yaml__validate @@ -1 +1,12 @@ -invalid components: schema "Account": invalid example: string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" +invalid components: schema "Account": invalid example: unhandled value of type time.Time +Schema: + { + "description": "Date of next billing", + "example": "2018-01-31T16:32:17.238553Z", + "format": "date", + "readOnly": true, + "type": "string" + } + +Value: + "2018-01-31T16:32:17.238553Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/proxykingdom_com_v1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/proxykingdom_com_v1_openapi_yaml__validate new file mode 100644 index 000000000..50379dcb8 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/proxykingdom_com_v1_openapi_yaml__validate @@ -0,0 +1,10 @@ +invalid paths: invalid path /proxy: invalid operation GET: invalid example: Error at "/lastTested": unhandled value of type time.Time +Schema: + { + "nullable": true, + "readOnly": true, + "type": "string" + } + +Value: + "2023-04-23T08:56:13Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/prss_org_2_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/prss_org_2_0_0_openapi_yaml__validate new file mode 100644 index 000000000..4954d662d --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/prss_org_2_0_0_openapi_yaml__validate @@ -0,0 +1,11 @@ +invalid components: schema "SpotInsertion": invalid example: unhandled value of type time.Time +Schema: + { + "description": "The date the spot insertion ends. The time will be set to midnight Eastern Time.", + "example": "2020-01-31T00:00:00Z", + "format": "date", + "type": "string" + } + +Value: + "2020-01-31T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/qualtrics_com_0_2_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/qualtrics_com_0_2_openapi_yaml__validate new file mode 100644 index 000000000..880d2d76c --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/qualtrics_com_0_2_openapi_yaml__validate @@ -0,0 +1,9 @@ +invalid components: schema "CreateDistributionLinks": invalid example: unhandled value of type time.Time +Schema: + { + "example": "2021-01-21T00:00:00Z", + "type": "string" + } + +Value: + "2021-01-21T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/rapidapi_com_ecowetter_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/rapidapi_com_ecowetter_1_0_0_openapi_yaml__validate new file mode 100644 index 000000000..d744cc2d3 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/rapidapi_com_ecowetter_1_0_0_openapi_yaml__validate @@ -0,0 +1,8 @@ +invalid paths: invalid path /public/history: invalid operation GET: invalid example: unhandled value of type time.Time +Schema: + { + "type": "string" + } + +Value: + "2021-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/rebilly_com_2_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/rebilly_com_2_1_openapi_yaml__validate index 164870ca1..a0eebd2ce 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/rebilly_com_2_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/rebilly_com_2_1_openapi_yaml__validate @@ -1 +1,12 @@ -invalid components: schema "AML": invalid example: string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" +invalid components: schema "AML": invalid example: unhandled value of type time.Time +Schema: + { + "description": "Date of birth.", + "example": "1706-01-17T00:00:00Z", + "format": "date", + "readOnly": true, + "type": "string" + } + +Value: + "1706-01-17T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/rentcast_io_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/rentcast_io_1_0_openapi_yaml__validate index fe6355c60..40b3cdf2e 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/rentcast_io_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/rentcast_io_1_0_openapi_yaml__validate @@ -1,4 +1,4 @@ -invalid paths: invalid path /avm/rent/long-term: invalid operation GET: invalid example: example Response: validation failed due to: at '': got string, want object +invalid paths: invalid path /avm/rent/long-term: invalid operation GET: invalid example: validation failed due to: at '': invalid jsonType time.Time Schema: null diff --git a/openapi3/testdata/apis_guru_openapi_directory/salesloft_com_v2_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/salesloft_com_v2_openapi_yaml__validate index 473f15ed2..58bfc353a 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/salesloft_com_v2_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/salesloft_com_v2_openapi_yaml__validate @@ -1,14 +1,11 @@ -invalid components: schema "ActivityHistory": invalid example: value must be an object +invalid components: schema "Account": invalid example: unhandled value of type time.Time Schema: { - "description": "A list of remote resource names that failed to load. This is specific to the type of activity and may change over time. Not returned for create requests", - "example": [ - "email" - ], - "type": "object" + "description": "Datetime of when the Account was archived, if archived", + "example": "2022-01-01T00:00:00-05:00", + "format": "date-time", + "type": "string" } Value: - [ - "email" - ] + "2022-01-01T00:00:00-05:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/sendgrid_com_1_0_0_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/sendgrid_com_1_0_0_openapi_yaml__load index e5fb18fb8..f6be00efb 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/sendgrid_com_1_0_0_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/sendgrid_com_1_0_0_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: control characters are not allowed +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: control characters are not allowed diff --git a/openapi3/testdata/apis_guru_openapi_directory/shipengine_com_1_1_202304191404_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/shipengine_com_1_1_202304191404_openapi_yaml__validate index 1fd00f26e..338beeca3 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/shipengine_com_1_1_202304191404_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/shipengine_com_1_1_202304191404_openapi_yaml__validate @@ -1,11 +1,13 @@ -invalid components: schema "address_validating_shipment": invalid allOf element: invalid example: value must be a string +invalid components: schema "account_settings_images": invalid allOf element: invalid example: unhandled value of type time.Time Schema: { - "description": "The National Motor Freight Traffic Association [freight class](http://www.nmfta.org/pages/nmfc?AspxAutoDetectCookieSupport=1), such as \"77.5\", \"110\", or \"250\".\n", - "example": 77.5, - "nullable": true, + "description": "An [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) string that represents a date and time.\n", + "example": "2018-09-23T15:00:00Z", + "format": "date-time", + "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[-+]\\d{2}:\\d{2})$", + "title": "date_time", "type": "string" } Value: - 77.5 + "2018-09-23T15:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/shorten_rest_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/shorten_rest_1_0_0_openapi_yaml__validate new file mode 100644 index 000000000..179f29ea8 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/shorten_rest_1_0_0_openapi_yaml__validate @@ -0,0 +1,10 @@ +invalid components: schema "ClicksFilterModel": invalid example: unhandled value of type time.Time +Schema: + { + "description": "date From", + "example": "2001-05-02T00:00:00Z", + "type": "string" + } + +Value: + "2001-05-02T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/shutterstock_com_1_1_32_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/shutterstock_com_1_1_32_openapi_yaml__validate index 98d64af2d..0b0bc4b68 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/shutterstock_com_1_1_32_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/shutterstock_com_1_1_32_openapi_yaml__validate @@ -1,27 +1,20 @@ -invalid components: schema "AudioUrl": invalid example: Error at "/url": property "url" is missing +invalid components: schema "Allotment": invalid example: Error at "/end_time": unhandled value of type time.Time Schema: { - "description": "Audio License URL object", - "example": { - "$ref": "#/components/schemas/Url/example" - }, - "properties": { - "shorts_loops_stems": { - "description": "URL that can be used to download the .zip file containing shorts, loops, and stems", - "type": "string" - }, - "url": { - "description": "URL that can be used to download the unwatermarked, licensed asset", - "type": "string" - } - }, - "required": [ - "url" - ], - "type": "object" + "description": "Date the subscription ends", + "format": "date-time", + "type": "string" } Value: + "2020-05-29T12:10:22-05:00" + | Error at "/start_time": unhandled value of type time.Time +Schema: { - "$ref": "#/components/schemas/Url/example" + "description": "Date the subscription started", + "format": "date-time", + "type": "string" } + +Value: + "2020-05-29T12:10:22-05:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/snyk_io_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/snyk_io_1_0_0_openapi_yaml__validate index 8ba66eb30..945bcd8f5 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/snyk_io_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/snyk_io_1_0_0_openapi_yaml__validate @@ -1,8 +1,8 @@ -invalid paths: invalid path /group/{groupId}/audit: invalid operation POST: invalid example: value must be a number +invalid paths: invalid path /group/{groupId}/audit: invalid operation POST: invalid example: unhandled value of type time.Time Schema: { - "type": "number" + "type": "string" } Value: - "1" + "2019-07-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/spotify_com_sonallux_2023_2_27_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/spotify_com_sonallux_2023_2_27_openapi_yaml__validate new file mode 100644 index 000000000..f2848383b --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/spotify_com_sonallux_2023_2_27_openapi_yaml__validate @@ -0,0 +1,10 @@ +invalid components: schema "AudiobookObject": invalid allOf element: invalid example: unhandled value of type time.Time +Schema: + { + "description": "The date the episode was first released, for example `\"1981-12-15\"`. Depending on the precision, it might be shown as `\"1981\"` or `\"1981-12\"`.\n", + "example": "1981-12-15T00:00:00Z", + "type": "string" + } + +Value: + "1981-12-15T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/squareup_com_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/squareup_com_2_0_openapi_yaml__validate index ac67f7960..ec5b5e3e8 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/squareup_com_2_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/squareup_com_2_0_openapi_yaml__validate @@ -1,147 +1,35 @@ -invalid components: schema "AccumulateLoyaltyPointsRequest": invalid example: Error at "/accumulate_points": property "accumulate_points" is missing +invalid components: schema "AcceptDisputeResponse": invalid example: Error at "/dispute/created_at": unhandled value of type time.Time Schema: { - "description": "A request to accumulate points for a purchase.", - "example": { - "request_body": { - "accumulate_points": { - "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY" - }, - "idempotency_key": "58b90739-c3e8-4b11-85f7-e636d48d72cb", - "location_id": "P034NEENMD09F" - }, - "request_params": "?account_id=5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd" - }, - "properties": { - "accumulate_points": { - "$ref": "#/components/schemas/LoyaltyEventAccumulatePoints" - }, - "idempotency_key": { - "description": "A unique string that identifies the `AccumulateLoyaltyPoints` request. \nKeys can be any valid string but must be unique for every request.", - "maxLength": 128, - "minLength": 1, - "type": "string" - }, - "location_id": { - "description": "The [location](https://developer.squareup.com/reference/square_2021-08-18/objects/Location) where the purchase was made.", - "type": "string" - } - }, - "required": [ - "accumulate_points", - "idempotency_key", - "location_id" - ], - "type": "object", - "x-release-status": "PUBLIC" + "description": "The timestamp when the dispute was created, in RFC 3339 format.", + "maxLength": 40, + "minLength": 1, + "type": "string", + "x-read-only": true } Value: - { - "request_body": { - "accumulate_points": { - "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY" - }, - "idempotency_key": "58b90739-c3e8-4b11-85f7-e636d48d72cb", - "location_id": "P034NEENMD09F" - }, - "request_params": "?account_id=5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd" - } - | Error at "/idempotency_key": property "idempotency_key" is missing + "2018-10-18T15:59:13.613Z" + | Error at "/dispute/due_at": unhandled value of type time.Time Schema: { - "description": "A request to accumulate points for a purchase.", - "example": { - "request_body": { - "accumulate_points": { - "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY" - }, - "idempotency_key": "58b90739-c3e8-4b11-85f7-e636d48d72cb", - "location_id": "P034NEENMD09F" - }, - "request_params": "?account_id=5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd" - }, - "properties": { - "accumulate_points": { - "$ref": "#/components/schemas/LoyaltyEventAccumulatePoints" - }, - "idempotency_key": { - "description": "A unique string that identifies the `AccumulateLoyaltyPoints` request. \nKeys can be any valid string but must be unique for every request.", - "maxLength": 128, - "minLength": 1, - "type": "string" - }, - "location_id": { - "description": "The [location](https://developer.squareup.com/reference/square_2021-08-18/objects/Location) where the purchase was made.", - "type": "string" - } - }, - "required": [ - "accumulate_points", - "idempotency_key", - "location_id" - ], - "type": "object", - "x-release-status": "PUBLIC" + "description": "The time when the next action is due, in RFC 3339 format.", + "maxLength": 40, + "minLength": 1, + "type": "string" } Value: - { - "request_body": { - "accumulate_points": { - "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY" - }, - "idempotency_key": "58b90739-c3e8-4b11-85f7-e636d48d72cb", - "location_id": "P034NEENMD09F" - }, - "request_params": "?account_id=5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd" - } - | Error at "/location_id": property "location_id" is missing + "2018-11-01T00:00:00Z" + | Error at "/dispute/updated_at": unhandled value of type time.Time Schema: { - "description": "A request to accumulate points for a purchase.", - "example": { - "request_body": { - "accumulate_points": { - "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY" - }, - "idempotency_key": "58b90739-c3e8-4b11-85f7-e636d48d72cb", - "location_id": "P034NEENMD09F" - }, - "request_params": "?account_id=5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd" - }, - "properties": { - "accumulate_points": { - "$ref": "#/components/schemas/LoyaltyEventAccumulatePoints" - }, - "idempotency_key": { - "description": "A unique string that identifies the `AccumulateLoyaltyPoints` request. \nKeys can be any valid string but must be unique for every request.", - "maxLength": 128, - "minLength": 1, - "type": "string" - }, - "location_id": { - "description": "The [location](https://developer.squareup.com/reference/square_2021-08-18/objects/Location) where the purchase was made.", - "type": "string" - } - }, - "required": [ - "accumulate_points", - "idempotency_key", - "location_id" - ], - "type": "object", - "x-release-status": "PUBLIC" + "description": "The timestamp when the dispute was last updated, in RFC 3339 format.", + "maxLength": 40, + "minLength": 1, + "type": "string", + "x-read-only": true } Value: - { - "request_body": { - "accumulate_points": { - "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY" - }, - "idempotency_key": "58b90739-c3e8-4b11-85f7-e636d48d72cb", - "location_id": "P034NEENMD09F" - }, - "request_params": "?account_id=5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd" - } + "2018-10-18T15:59:13.613Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/statsocial_com_1_0_0_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/statsocial_com_1_0_0_openapi_yaml__load deleted file mode 100644 index 099ffe7fb..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/statsocial_com_1_0_0_openapi_yaml__load +++ /dev/null @@ -1 +0,0 @@ -map key "18_24" not found diff --git a/openapi3/testdata/apis_guru_openapi_directory/taxrates_io_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/taxrates_io_1_0_0_openapi_yaml__validate new file mode 100644 index 000000000..87c7c3af9 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/taxrates_io_1_0_0_openapi_yaml__validate @@ -0,0 +1,9 @@ +invalid paths: invalid path /v1/tax/countrycode: invalid operation GET: parameter "date" schema is invalid: invalid example: unhandled value of type time.Time +Schema: + { + "example": "2020-09-02T00:00:00Z", + "type": "string" + } + +Value: + "2020-09-02T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/telematicssdk_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/telematicssdk_com_1_0_0_openapi_yaml__validate new file mode 100644 index 000000000..c5805224b --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/telematicssdk_com_1_0_0_openapi_yaml__validate @@ -0,0 +1,9 @@ +invalid paths: invalid path /mobilesdk/stage/track/get_track/v1: invalid operation GET: invalid example: unhandled value of type time.Time +Schema: + { + "example": "2021-02-27T13:42:48+01:00", + "type": "string" + } + +Value: + "2021-02-27T13:42:48+01:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/telnyx_com_2_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/telnyx_com_2_0_0_openapi_yaml__validate index 78b05cc87..9a17822ca 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/telnyx_com_2_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/telnyx_com_2_0_0_openapi_yaml__validate @@ -1,10 +1,10 @@ -invalid components: schema "BillingGroup": invalid example: Error at "/deleted_at": Value is not nullable +invalid components: schema "Address": invalid example: unhandled value of type time.Time Schema: { - "description": "ISO 8601 formatted date indicating when the resource was removed.", - "format": "date-time", + "description": "ISO 8601 formatted date indicating when the resource was created.", + "example": "2018-02-02T22:25:27.521Z", "type": "string" } Value: - null + "2018-02-02T22:25:27.521Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/theracingapi_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/theracingapi_com_1_0_0_openapi_yaml__validate new file mode 100644 index 000000000..bf2a43549 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/theracingapi_com_1_0_0_openapi_yaml__validate @@ -0,0 +1,11 @@ +invalid paths: invalid path /v1/racecards/pro: invalid operation GET: parameter "date" schema is invalid: invalid default: unhandled value of type time.Time +Schema: + { + "default": "2023-10-15T00:00:00Z", + "description": "Query racecards by date with format YYYY-MM-DD (e.g 2023-04-05)", + "title": "Date", + "type": "string" + } + +Value: + "2023-10-15T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/tokenmetrics_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/tokenmetrics_com_1_0_0_openapi_yaml__validate new file mode 100644 index 000000000..6bce3d275 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/tokenmetrics_com_1_0_0_openapi_yaml__validate @@ -0,0 +1,9 @@ +invalid paths: invalid path /v1/indices: invalid operation GET: parameter "startDate" schema is invalid: invalid example: unhandled value of type time.Time +Schema: + { + "example": "2023-01-10T00:00:00Z", + "type": "string" + } + +Value: + "2023-01-10T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/twinehealth_com_v7_78_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/twinehealth_com_v7_78_1_openapi_yaml__validate index 59bf42ee6..2c5a34a02 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/twinehealth_com_v7_78_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/twinehealth_com_v7_78_1_openapi_yaml__validate @@ -1,9 +1,10 @@ -invalid components: schema "CalendarEventResource": invalid example: Error at "/attributes/completed_by": value must be an object +invalid components: schema "ArchiveHistory": invalid example: unhandled value of type time.Time Schema: { - "description": "The coach who marked the calendar event as completed. Only valid for `plan-check-in` event type.", - "type": "object" + "example": "2016-06-03T13:15:22Z", + "format": "dateTime", + "type": "string" } Value: - "5a0c8e27a9d454cc150997c9" + "2016-06-03T13:15:22Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/twitter_com_current_2_62_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/twitter_com_current_2_62_openapi_yaml__validate index 0a83aee3a..d8a44ada4 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/twitter_com_current_2_62_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/twitter_com_current_2_62_openapi_yaml__validate @@ -1,267 +1,11 @@ -invalid components: schema "Expansions": invalid example: Error at "/created_at": string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" | Error at "/edit_history_tweet_ids": property "edit_history_tweet_ids" is missing +invalid components: schema "ComplianceJob": invalid example: unhandled value of type time.Time Schema: { - "example": { - "author_id": "2244994945", - "created_at": "Wed Jan 06 18:40:40 +0000 2021", - "id": "1346889436626259968", - "text": "Learn how to use the user Tweet timeline and user mention timeline endpoints in the Twitter API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i" - }, - "properties": { - "attachments": { - "description": "Specifies the type of attachments (if any) present in this Tweet.", - "properties": { - "media_keys": { - "description": "A list of Media Keys for each one of the media attachments (if media are attached).", - "items": { - "$ref": "#/components/schemas/MediaKey" - }, - "minItems": 1, - "type": "array" - }, - "poll_ids": { - "description": "A list of poll IDs (if polls are attached).", - "items": { - "$ref": "#/components/schemas/PollId" - }, - "minItems": 1, - "type": "array" - } - }, - "type": "object" - }, - "author_id": { - "$ref": "#/components/schemas/UserId" - }, - "context_annotations": { - "items": { - "$ref": "#/components/schemas/ContextAnnotation" - }, - "minItems": 1, - "type": "array" - }, - "conversation_id": { - "$ref": "#/components/schemas/TweetId" - }, - "created_at": { - "description": "Creation time of the Tweet.", - "example": "2021-01-06T18:40:40.000Z", - "format": "date-time", - "type": "string" - }, - "edit_controls": { - "properties": { - "editable_until": { - "description": "Time when Tweet is no longer editable.", - "example": "2021-01-06T18:40:40.000Z", - "format": "date-time", - "type": "string" - }, - "edits_remaining": { - "description": "Number of times this Tweet can be edited.", - "type": "integer" - }, - "is_edit_eligible": { - "description": "Indicates if this Tweet is eligible to be edited.", - "example": false, - "type": "boolean" - } - }, - "required": [ - "is_edit_eligible", - "editable_until", - "edits_remaining" - ], - "type": "object" - }, - "edit_history_tweet_ids": { - "description": "A list of Tweet Ids in this Tweet chain.", - "items": { - "$ref": "#/components/schemas/TweetId" - }, - "minItems": 1, - "type": "array" - }, - "entities": { - "$ref": "#/components/schemas/FullTextEntities" - }, - "geo": { - "description": "The location tagged on the Tweet, if the user provided one.", - "properties": { - "coordinates": { - "$ref": "#/components/schemas/Point" - }, - "place_id": { - "$ref": "#/components/schemas/PlaceId" - } - }, - "type": "object" - }, - "id": { - "$ref": "#/components/schemas/TweetId" - }, - "in_reply_to_user_id": { - "$ref": "#/components/schemas/UserId" - }, - "lang": { - "description": "Language of the Tweet, if detected by Twitter. Returned as a BCP47 language tag.", - "example": "en", - "type": "string" - }, - "non_public_metrics": { - "description": "Nonpublic engagement metrics for the Tweet at the time of the request.", - "properties": { - "impression_count": { - "description": "Number of times this Tweet has been viewed.", - "format": "int32", - "type": "integer" - } - }, - "type": "object" - }, - "organic_metrics": { - "description": "Organic nonpublic engagement metrics for the Tweet at the time of the request.", - "properties": { - "impression_count": { - "description": "Number of times this Tweet has been viewed.", - "type": "integer" - }, - "like_count": { - "description": "Number of times this Tweet has been liked.", - "type": "integer" - }, - "reply_count": { - "description": "Number of times this Tweet has been replied to.", - "type": "integer" - }, - "retweet_count": { - "description": "Number of times this Tweet has been Retweeted.", - "type": "integer" - } - }, - "required": [ - "impression_count", - "retweet_count", - "reply_count", - "like_count" - ], - "type": "object" - }, - "possibly_sensitive": { - "description": "Indicates if this Tweet contains URLs marked as sensitive, for example content suitable for mature audiences.", - "example": false, - "type": "boolean" - }, - "promoted_metrics": { - "description": "Promoted nonpublic engagement metrics for the Tweet at the time of the request.", - "properties": { - "impression_count": { - "description": "Number of times this Tweet has been viewed.", - "format": "int32", - "type": "integer" - }, - "like_count": { - "description": "Number of times this Tweet has been liked.", - "format": "int32", - "type": "integer" - }, - "reply_count": { - "description": "Number of times this Tweet has been replied to.", - "format": "int32", - "type": "integer" - }, - "retweet_count": { - "description": "Number of times this Tweet has been Retweeted.", - "format": "int32", - "type": "integer" - } - }, - "type": "object" - }, - "public_metrics": { - "description": "Engagement metrics for the Tweet at the time of the request.", - "properties": { - "impression_count": { - "description": "Number of times this Tweet has been viewed.", - "format": "int32", - "type": "integer" - }, - "like_count": { - "description": "Number of times this Tweet has been liked.", - "type": "integer" - }, - "quote_count": { - "description": "Number of times this Tweet has been quoted.", - "type": "integer" - }, - "reply_count": { - "description": "Number of times this Tweet has been replied to.", - "type": "integer" - }, - "retweet_count": { - "description": "Number of times this Tweet has been Retweeted.", - "type": "integer" - } - }, - "required": [ - "retweet_count", - "reply_count", - "like_count", - "impression_count" - ], - "type": "object" - }, - "referenced_tweets": { - "description": "A list of Tweets this Tweet refers to. For example, if the parent Tweet is a Retweet, a Quoted Tweet or a Reply, it will include the related Tweet referenced to by its parent.", - "items": { - "properties": { - "id": { - "$ref": "#/components/schemas/TweetId" - }, - "type": { - "enum": [ - "retweeted", - "quoted", - "replied_to" - ], - "type": "string" - } - }, - "required": [ - "type", - "id" - ], - "type": "object" - }, - "minItems": 1, - "type": "array" - }, - "reply_settings": { - "$ref": "#/components/schemas/ReplySettings" - }, - "source": { - "description": "This is deprecated.", - "type": "string" - }, - "text": { - "$ref": "#/components/schemas/TweetText" - }, - "withheld": { - "$ref": "#/components/schemas/TweetWithheld" - } - }, - "required": [ - "id", - "text", - "edit_history_tweet_ids" - ], - "type": "object" + "description": "Creation time of the compliance job.", + "example": "2021-01-06T18:40:40Z", + "format": "date-time", + "type": "string" } Value: - { - "author_id": "2244994945", - "created_at": "Wed Jan 06 18:40:40 +0000 2021", - "id": "1346889436626259968", - "text": "Learn how to use the user Tweet timeline and user mention timeline endpoints in the Twitter API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i" - } + "2021-01-06T18:40:40Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/unicourt_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/unicourt_com_1_0_0_openapi_yaml__validate index 0dc66a53a..ad2c8a18c 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/unicourt_com_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/unicourt_com_1_0_0_openapi_yaml__validate @@ -1,13 +1,13 @@ -invalid components: schema "Case": invalid example: minimum string length is 18 +invalid components: schema "AccessTokenIdListResponse": invalid example: unhandled value of type time.Time Schema: { - "description": "Document ID which is the parent document for the current document. This will be null if the current document is a parent document.", - "example": "CDOC3Ygn4ooAvNjHv", - "maxLength": 18, - "minLength": 18, - "nullable": true, + "description": "Date when access token was created.", + "example": "2022-11-10T10:17:56Z", + "format": "date-time", + "maxLength": 25, + "minLength": 25, "type": "string" } Value: - "CDOC3Ygn4ooAvNjHv" + "2022-11-10T10:17:56Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/up_com_au_v1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/up_com_au_v1_openapi_yaml__validate new file mode 100644 index 000000000..d8578f810 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/up_com_au_v1_openapi_yaml__validate @@ -0,0 +1,9 @@ +invalid paths: invalid path /accounts/{accountId}/transactions: invalid operation GET: invalid example: unhandled value of type time.Time +Schema: + { + "format": "date-time", + "type": "string" + } + +Value: + "2020-01-01T01:02:03+10:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/va_gov_benefits_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/va_gov_benefits_1_0_0_openapi_yaml__validate index 46db592e8..e44370dc4 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/va_gov_benefits_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/va_gov_benefits_1_0_0_openapi_yaml__validate @@ -1,10 +1,11 @@ -invalid components: schema "DocumentUploadStatus": invalid example: value must be an integer +invalid components: schema "DocumentUploadAttributes": invalid example: unhandled value of type time.Time Schema: { - "description": "The document height", - "example": "11.0", - "type": "integer" + "description": "The last time the submission was updated", + "example": "2018-07-30T17:31:15.958Z", + "format": "date-time", + "type": "string" } Value: - "11.0" + "2018-07-30T17:31:15.958Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/va_gov_confirmation_0_0_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/va_gov_confirmation_0_0_1_openapi_yaml__validate new file mode 100644 index 000000000..04ba3d8d7 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/va_gov_confirmation_0_0_1_openapi_yaml__validate @@ -0,0 +1,11 @@ +invalid components: schema "VeteranStatusRequest": invalid example: unhandled value of type time.Time +Schema: + { + "deprecated": true, + "description": "Birth date for the person of interest in any valid ISO8601 format", + "example": "1965-01-01T00:00:00Z", + "type": "string" + } + +Value: + "1965-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/va_gov_forms_0_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/va_gov_forms_0_0_0_openapi_yaml__validate index f7ab00f5d..2c20a9fa3 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/va_gov_forms_0_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/va_gov_forms_0_0_0_openapi_yaml__validate @@ -1,10 +1,12 @@ -invalid components: schema "FormShow": invalid example: value must be a boolean +invalid components: schema "FormShow": invalid example: unhandled value of type time.Time Schema: { - "description": "A flag indicating whether the form url was confirmed as a valid download", - "example": "true", - "type": "boolean" + "description": "Internal field for VA.gov use", + "example": "2021-03-30T16:28:30.338Z", + "format": "date-time", + "nullable": true, + "type": "string" } Value: - "true" + "2021-03-30T16:28:30.338Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vercel_com_0_0_1_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/vercel_com_0_0_1_openapi_yaml__load index 2a6522f53..44dd91250 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vercel_com_0_0_1_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/vercel_com_0_0_1_openapi_yaml__load @@ -1 +1,2 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal bool into field Schema.properties of type openapi3.Schema +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: unmarshal errors: + line 860: cannot unmarshal !!bool `false` into openapi3.SchemaBis diff --git a/openapi3/testdata/apis_guru_openapi_directory/viator_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/viator_com_1_0_0_openapi_yaml__validate index d6d4c760b..67faf17d3 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/viator_com_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/viator_com_1_0_0_openapi_yaml__validate @@ -1,225 +1,18 @@ -invalid paths: invalid path /available/products: invalid operation POST: invalid example: example 1: doesn't match schema due to: Error at "/errorMessage": value must be an array +invalid paths: invalid path /available/products: invalid operation POST: invalid example: Error at "/endDate": unhandled value of type time.Time Schema: { - "description": "**array** of error message strings", - "items": {}, - "nullable": true, - "type": "array" - } - -Value: - { - "$ref": "#/components/examples/product-example-1/value/data/pas" - } - | Error at "/errorMessageText": value must be a string -Schema: - { - "description": "**array** of error message strings in plain text", - "nullable": true, - "type": "string" - } - -Value: - { - "$ref": "#/components/examples/product-example-1/value/data/pas" - } - | Error at "/errorName": value must be a string -Schema: - { - "description": "**name** of *this* type of error", - "nullable": true, - "type": "string" - } - -Value: - { - "$ref": "#/components/examples/product-example-1/value/data/pas" - } - | Error at "/errorReference": value must be a string -Schema: - { - "description": "**reference number** of *this* error", - "nullable": true, - "type": "string" - } - -Value: - { - "$ref": "#/components/examples/product-example-1/value/data/pas" - } - | Error at "/errorType": value must be a string -Schema: - { - "description": "**code** specifying the type of error", - "nullable": true, - "type": "string" - } - -Value: - { - "$ref": "#/components/examples/product-example-1/value/data/pas" - } - And Error at "/data/0/admission": value must be a string -Schema: - { - "description": "ignore (Viator only)", - "type": "string" - } - -Value: - { - "$ref": "#/components/examples/product-example-1/value/data/pas" - } - | Error at "/data/0/essential": value must be a string -Schema: - { - "description": "ignore (Viator only)", - "type": "string" - } - -Value: - { - "$ref": "#/components/examples/product-example-1/value/data/pas" - } - | Error at "/data/0/onRequestPeriod": value must be an integer -Schema: - { - "description": "**number** of hours before the travel date that *this* product will be 'on-request' for\n- this field will contain a value if the `bookingEngineId` is `'FreesaleOnRequestBE'`\n- an `onRequestPeriod` of 48 hours means that *this* product is freesale up until 48 hours before the travel date, and is on-request for 48 hours or less until the travel date\n- **note**: 'hours in advance' (the number of hours a product is available for booking before the travel date) may also affect this; however, this value is not available in the API\n", - "nullable": true, - "type": "integer" - } - -Value: - { - "$ref": "#/components/examples/product-example-1/value/data/pas" - } - | Error at "/data/0/primaryGroupId": value must be a string -Schema: - { - "description": "ignore (Viator only)", - "type": "string" - } - -Value: - { - "$ref": "#/components/examples/product-example-1/value/data/pas" - } - | Error at "/data/0/savingAmount": value must be a string -Schema: - { - "description": "Ignore (Viator only)\n", - "type": "string" - } - -Value: - 0 - | Error at "/data/0/specialReservationDetails": value must be a string -Schema: - { - "description": "ignore (Viator only)", - "type": "string" - } - -Value: - { - "$ref": "#/components/examples/product-example-1/value/data/pas" - } - | Error at "/data/0/uniqueShortDescription": value must be a string -Schema: - { - "description": "**natural-language description** of *this* product", - "type": "string" - } - -Value: - { - "$ref": "#/components/examples/product-example-1/value/data/pas" - } - | Error at "/data/0/webURL": value must be a string -Schema: - { - "description": "ignore (Viator only)", - "nullable": true, - "type": "string" - } - -Value: - { - "$ref": "#/components/examples/product-example-1/value/data/pas" - } - | Error at "/data/1/admission": value must be a string -Schema: - { - "description": "ignore (Viator only)", + "description": "**end date** of the date range to search within (must be in the future)", "type": "string" } Value: - { - "$ref": "#/components/examples/product-example-1/value/data/pas" - } - | Error at "/data/1/essential": value must be a string + "2020-12-31T00:00:00Z" + | Error at "/startDate": unhandled value of type time.Time Schema: { - "description": "ignore (Viator only)", + "description": "**start date** of the date range to search within (must be in the future)", "type": "string" } Value: - { - "$ref": "#/components/examples/product-example-1/value/data/pas" - } - | Error at "/data/1/primaryGroupId": value must be a string -Schema: - { - "description": "ignore (Viator only)", - "type": "string" - } - -Value: - { - "$ref": "#/components/examples/product-example-1/value/data/pas" - } - | Error at "/data/1/savingAmount": value must be a string -Schema: - { - "description": "Ignore (Viator only)\n", - "type": "string" - } - -Value: - 0 - | Error at "/data/1/specialReservationDetails": value must be a string -Schema: - { - "description": "ignore (Viator only)", - "type": "string" - } - -Value: - { - "$ref": "#/components/examples/product-example-1/value/data/pas" - } - | Error at "/data/1/uniqueShortDescription": value must be a string -Schema: - { - "description": "**natural-language description** of *this* product", - "type": "string" - } - -Value: - { - "$ref": "#/components/examples/product-example-1/value/data/pas" - } - | Error at "/data/1/webURL": value must be a string -Schema: - { - "description": "ignore (Viator only)", - "nullable": true, - "type": "string" - } - -Value: - { - "$ref": "#/components/examples/product-example-1/value/data/pas" - } + "2020-12-21T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/visualcrossing_com_weather_4_6_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/visualcrossing_com_weather_4_6_openapi_yaml__validate index f814141f6..c4cfe7b03 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/visualcrossing_com_weather_4_6_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/visualcrossing_com_weather_4_6_openapi_yaml__validate @@ -1,8 +1,8 @@ -invalid paths: invalid path /VisualCrossingWebServices/rest/services/weatherdata/forecast: invalid operation GET: invalid example: value must be a boolean +invalid paths: invalid path /VisualCrossingWebServices/rest/services/timeline/{location}/{startdate}: invalid operation GET: invalid example: unhandled value of type time.Time Schema: { - "type": "boolean" + "type": "string" } Value: - "false" + "2022-02-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vonage_com_reports_1_0_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vonage_com_reports_1_0_1_openapi_yaml__validate index 492766a51..d11bacf46 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vonage_com_reports_1_0_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/vonage_com_reports_1_0_1_openapi_yaml__validate @@ -1,10 +1,10 @@ -invalid components: schema "CallLog": invalid example: value must be a string +invalid components: schema "CallLog": invalid example: unhandled value of type time.Time Schema: { - "description": "Source number of the call", - "example": 17325550100, + "description": "End time of the call", + "example": "2019-01-01T00:00:00Z", "type": "string" } Value: - 17325550100 + "2019-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Catalog_API_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Catalog_API_1_0_openapi_yaml__validate index 83eb9c663..dd8702286 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Catalog_API_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Catalog_API_1_0_openapi_yaml__validate @@ -1 +1,10 @@ -invalid paths: conflicting paths "/api/catalog/pvt/subcollection/{subCollectionId}/brand/{categoryId}" and "/api/catalog/pvt/subcollection/{subCollectionId}/brand/{brandId}" +invalid components: schema "GetSKUAltID": invalid example: Error at "/ReleaseDate": unhandled value of type time.Time +Schema: + { + "description": "Release date of the product.", + "nullable": true, + "type": "string" + } + +Value: + "2020-01-06T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Catalog_API_Seller_Portal_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Catalog_API_Seller_Portal_1_0_0_openapi_yaml__validate index e98368b50..b16bc2b99 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Catalog_API_Seller_Portal_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Catalog_API_Seller_Portal_1_0_0_openapi_yaml__validate @@ -1 +1,11 @@ -invalid paths: conflicting paths "/api/catalog-seller-portal/products/{productId}" and "/api/catalog-seller-portal/products/{param}" +invalid paths: invalid path /api/catalog-seller-portal/brands: invalid operation GET: invalid example: unhandled value of type time.Time +Schema: + { + "description": "Date when the brand was created.", + "example": "2021-01-18T14:41:45.696488Z", + "title": "createdAt", + "type": "string" + } + +Value: + "2021-01-18T14:41:45.696488Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Checkout_API_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Checkout_API_1_0_openapi_yaml__validate index bf6d441f5..039a70561 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Checkout_API_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Checkout_API_1_0_openapi_yaml__validate @@ -1,4 +1,13 @@ -invalid paths: invalid path /api/checkout/pub/orderForm/{orderFormId}/coupons: invalid operation POST: invalid example: example response: Error at "/shippingData/logisticsInfo/0/slas/0/deliveryIds/0/warehouseId": value must be a string +invalid paths: invalid path /api/checkout/pub/orderForm/{orderFormId}/coupons: invalid operation POST: invalid example: example response: Error at "/items/0/priceValidUntil": unhandled value of type time.Time +Schema: + { + "description": "Price expiration date and time.", + "type": "string" + } + +Value: + "2022-07-13T18:30:46Z" + | Error at "/shippingData/logisticsInfo/0/slas/0/deliveryIds/0/warehouseId": value must be a string Schema: { "description": "Warehouse ID.", diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Customer_Credit_API_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Customer_Credit_API_1_0_openapi_yaml__validate index d57c88ea8..1766f791d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Customer_Credit_API_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Customer_Credit_API_1_0_openapi_yaml__validate @@ -1,10 +1,8 @@ -invalid paths: invalid path /api/creditcontrol/accounts/{accountId}: invalid operation PUT: invalid default: value must be an integer +invalid components: schema "Datum2": invalid example: Error at "/lastUpdate": unhandled value of type time.Time Schema: { - "default": "100.0", - "description": "If the user don't set a credit limit, the system will define 100 for default", - "type": "integer" + "type": "string" } Value: - "100.0" + "2017-07-06T01:57:39.4317119Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Giftcard_API_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Giftcard_API_1_0_openapi_yaml__validate new file mode 100644 index 000000000..d99aa1c57 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Giftcard_API_1_0_openapi_yaml__validate @@ -0,0 +1,10 @@ +invalid components: schema "CreateGiftCardRequest": invalid example: unhandled value of type time.Time +Schema: + { + "description": "It must be in the format `YYYY-MM-DDThh:mm:ss.fff`.", + "example": "2020-09-01T13:15:30Z", + "type": "string" + } + +Value: + "2020-09-01T13:15:30Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Marketplace_Protocol_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Marketplace_Protocol_1_0_openapi_yaml__validate index 40adbc080..d7d10a6d8 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Marketplace_Protocol_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Marketplace_Protocol_1_0_openapi_yaml__validate @@ -1,9 +1,10 @@ -invalid paths: invalid path /api/checkout/pub/orderForms/simulation: invalid operation POST: invalid example: Error at "/logisticsInfo/0/slas/0/deliveryIds/0/warehouseId": value must be a string +invalid components: schema "orderPlacement": invalid example: unhandled value of type time.Time Schema: { - "description": "Warehouse ID.", + "description": "Scheduled delivery window end date in UTC.", + "example": "2016-04-20T12:00:00Z", "type": "string" } Value: - 11 + "2016-04-20T12:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_MasterData_API__1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_MasterData_API__1_0_openapi_yaml__validate new file mode 100644 index 000000000..9cc9311c2 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_MasterData_API__1_0_openapi_yaml__validate @@ -0,0 +1,16 @@ +invalid components: schema "ArEVentilaO": invalid example: Error at "/Date": unhandled value of type time.Time +Schema: + { + "type": "string" + } + +Value: + "2016-10-18T16:53:31.0842607Z" + | Error at "/Until": unhandled value of type time.Time +Schema: + { + "type": "string" + } + +Value: + "2017-04-16T16:53:31.0842607Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Master_Data_API__1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Master_Data_API__1_0_openapi_yaml__validate new file mode 100644 index 000000000..9cc9311c2 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Master_Data_API__1_0_openapi_yaml__validate @@ -0,0 +1,16 @@ +invalid components: schema "ArEVentilaO": invalid example: Error at "/Date": unhandled value of type time.Time +Schema: + { + "type": "string" + } + +Value: + "2016-10-18T16:53:31.0842607Z" + | Error at "/Until": unhandled value of type time.Time +Schema: + { + "type": "string" + } + +Value: + "2017-04-16T16:53:31.0842607Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Orders_API_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Orders_API_1_0_openapi_yaml__validate index 41725b9d4..fee48a580 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Orders_API_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Orders_API_1_0_openapi_yaml__validate @@ -1,9 +1,9 @@ -invalid components: schema "DeliveryId": invalid example: Error at "/warehouseId": value must be a string +invalid components: schema "ChangesAttachment": invalid example: Error at "/date": unhandled value of type time.Time Schema: { - "description": "ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb).", + "description": "Date when the receipt was created.", "type": "string" } Value: - 11 + "2019-02-06T20:46:04.4003606Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Orders_API__PII_version__1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Orders_API__PII_version__1_0_openapi_yaml__validate index c811d26df..23ca7a968 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Orders_API__PII_version__1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Orders_API__PII_version__1_0_openapi_yaml__validate @@ -1,9 +1,9 @@ -invalid components: schema "DeliveryId": invalid example: Error at "/warehouseId": value must be a string +invalid components: schema "ChangesAttachment": invalid example: Error at "/date": unhandled value of type time.Time Schema: { - "description": "Warehouse ID.", + "description": "Date.", "type": "string" } Value: - 11 + "2019-02-06T20:46:04.4003606Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Payments_Gateway_API_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Payments_Gateway_API_1_0_openapi_yaml__validate new file mode 100644 index 000000000..0e97dbe87 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Payments_Gateway_API_1_0_openapi_yaml__validate @@ -0,0 +1,8 @@ +invalid components: schema "Action": invalid example: Error at "/date": unhandled value of type time.Time +Schema: + { + "type": "string" + } + +Value: + "2018-06-05T12:55:58.6262759Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Pricing_API_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Pricing_API_1_0_openapi_yaml__validate new file mode 100644 index 000000000..11ae3d6fb --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Pricing_API_1_0_openapi_yaml__validate @@ -0,0 +1,18 @@ +invalid components: schema "DateRange": invalid example: Error at "/from": unhandled value of type time.Time +Schema: + { + "description": "Indicates the date and time when the fixed price will start to be valid.", + "type": "string" + } + +Value: + "2017-12-07T14:30:00Z" + | Error at "/to": unhandled value of type time.Time +Schema: + { + "description": "Indicates the date and time from which the fixed price will no longer be valid.", + "type": "string" + } + +Value: + "2017-12-30T14:30:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Pricing_Hub_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Pricing_Hub_1_0_openapi_yaml__validate new file mode 100644 index 000000000..baa2496a2 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Pricing_Hub_1_0_openapi_yaml__validate @@ -0,0 +1,18 @@ +invalid paths: invalid path /api/pricing-hub/prices: invalid operation POST: invalid example: Error at "/items/0/priceValidUntil": unhandled value of type time.Time +Schema: + { + "description": "The moment up until the price is valid. After that moment, it will be necessary to call the pricing API again. The format of the string is in RFC3339", + "type": "string" + } + +Value: + "2022-03-24T14:57:19Z" + | Error at "/items/1/priceValidUntil": unhandled value of type time.Time +Schema: + { + "description": "The moment up until the price is valid. After that moment, it will be necessary to call the pricing API again. The format of the string is in RFC3339", + "type": "string" + } + +Value: + "2022-03-04T20:00:18Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Profile_System_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Profile_System_1_0_openapi_yaml__validate new file mode 100644 index 000000000..cb6373e30 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Profile_System_1_0_openapi_yaml__validate @@ -0,0 +1,10 @@ +invalid components: schema "profile": invalid example: unhandled value of type time.Time +Schema: + { + "description": "Client's birth date in ISO 8601 format.", + "example": "1925-11-17T00:00:00Z", + "type": "string" + } + +Value: + "1925-11-17T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Promotions__1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Promotions__1_0_openapi_yaml__validate new file mode 100644 index 000000000..10c11cc60 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Promotions__1_0_openapi_yaml__validate @@ -0,0 +1,16 @@ +invalid components: schema "SavepriceRequest": invalid example: Error at "/validFrom": unhandled value of type time.Time +Schema: + { + "type": "string" + } + +Value: + "2016-01-01T02:00:00Z" + | Error at "/validTo": unhandled value of type time.Time +Schema: + { + "type": "string" + } + +Value: + "2017-01-01T02:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Reviews_and_Ratings_API_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Reviews_and_Ratings_API_1_0_openapi_yaml__validate new file mode 100644 index 000000000..6727db4cd --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Reviews_and_Ratings_API_1_0_openapi_yaml__validate @@ -0,0 +1,9 @@ +invalid paths: invalid path /review: invalid operation POST: invalid example: Error at "/searchDate": unhandled value of type time.Time +Schema: + { + "description": "Review's search date.", + "type": "string" + } + +Value: + "2022-04-19T18:55:58Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Search_API_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Search_API_1_0_openapi_yaml__validate new file mode 100644 index 000000000..10cda0948 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Search_API_1_0_openapi_yaml__validate @@ -0,0 +1,11 @@ +invalid paths: invalid path /api/catalog_system/pub/products/crossselling/whoboughtalsobought/{productId}: invalid operation GET: invalid example: unhandled value of type time.Time +Schema: + { + "description": "Date and time of the last update of the image.", + "example": "2020-10-07T12:49:27.58Z", + "title": "imageLastModified", + "type": "string" + } + +Value: + "2020-10-07T12:49:27.58Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Subscriptions_API__v2__1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Subscriptions_API__v2__1_0_openapi_yaml__validate index 8353ea5f0..2c634e169 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Subscriptions_API__v2__1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Subscriptions_API__v2__1_0_openapi_yaml__validate @@ -1,18 +1,16 @@ -invalid components: schema "settings": invalid example: value must be an array +invalid components: schema "Item1": invalid example: Error at "/createdAt": unhandled value of type time.Time Schema: { - "default": [], - "description": "Array containing delivery channels.", - "example": "delivery", - "items": { - "default": "", - "description": "Type of delivery channel. The values that are possible are: `pickup-in-point` for pickup point and `delivery` for regular delivery.", - "example": "delivery", - "type": "string" - }, - "title": "deliveryChannels", - "type": "array" + "type": "string" } Value: - "delivery" + "2019-06-20T18:27:41.23Z" + | Error at "/lastUpdate": unhandled value of type time.Time +Schema: + { + "type": "string" + } + +Value: + "2019-06-20T18:27:41.23Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_VTEX_Do_API_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_VTEX_Do_API_1_0_openapi_yaml__validate new file mode 100644 index 000000000..6dc280d6a --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_VTEX_Do_API_1_0_openapi_yaml__validate @@ -0,0 +1,8 @@ +invalid components: schema "NewTaskRequest": invalid example: Error at "/dueDate": unhandled value of type time.Time +Schema: + { + "type": "string" + } + +Value: + "2016-03-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/wealthreader_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/wealthreader_com_1_0_0_openapi_yaml__validate index 38ec15062..1f98f0872 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/wealthreader_com_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/wealthreader_com_1_0_0_openapi_yaml__validate @@ -1,10 +1,10 @@ -invalid components: schema "entities": invalid example: value must be a boolean +invalid components: schema "accounts": invalid example: unhandled value of type time.Time Schema: { - "description": "Indica si el campo es requerido", - "example": 0, - "type": "boolean" + "example": "2022-12-30T00:00:00Z", + "format": "date", + "type": "string" } Value: - 0 + "2022-12-30T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/zuora_com_2021_08_20_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/zuora_com_2021_08_20_openapi_yaml__validate index 0fef903bc..368949863 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/zuora_com_2021_08_20_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/zuora_com_2021_08_20_openapi_yaml__validate @@ -1,197 +1,10 @@ -invalid components: schema "CreditMemoFromChargeType": invalid example: doesn't match schema due to: Error at "/charges/0": doesn't match schema due to: Error at "/amount": Value is not nullable +invalid components: schema "ApplyCreditMemoType": invalid example: Error at "/effectiveDate": unhandled value of type time.Time Schema: { - "description": "The amount of the credit memo item.\n\n**Note**: This field is only available if you set the `zuora-version` request header to `224.0` or later.\n", - "format": "double", - "type": "number" + "description": "The date when the credit memo is applied.\n", + "format": "date", + "type": "string" } Value: - null - | Error at "/productRatePlanChargeId": property "productRatePlanChargeId" is missing -Schema: - { - "properties": { - "amount": { - "description": "The amount of the credit memo item.\n\n**Note**: This field is only available if you set the `zuora-version` request header to `224.0` or later.\n", - "format": "double", - "type": "number" - }, - "chargeId": { - "description": "The ID of the product rate plan charge that the credit memo is created from.\n\n**Note**: This field is not available if you set the `zuora-version` request header to `257.0` or later.\n", - "type": "string" - }, - "comment": { - "description": "Comments about the product rate plan charge.\n\n**Note**: This field is not available if you set the `zuora-version` request header to `257.0` or later.\n", - "maxLength": 255, - "type": "string" - }, - "description": { - "description": "The description of the product rate plan charge.\n\n**Note**: This field is only available if you set the `zuora-version` request header to `257.0` or later.\n", - "maxLength": 255, - "type": "string" - }, - "financeInformation": { - "description": "Container for the finance information related to the product rate plan charge associated with the credit memo.\n", - "properties": { - "deferredRevenueAccountingCode": { - "description": "The accounting code for the deferred revenue, such as Monthly Recurring Liability.\n", - "maxLength": 100, - "type": "string" - }, - "onAccountAccountingCode": { - "description": "The accounting code that maps to an on account in your accounting system.\n", - "maxLength": 100, - "type": "string" - }, - "recognizedRevenueAccountingCode": { - "description": "The accounting code for the recognized revenue, such as Monthly Recurring Charges or Overage Charges.\n", - "maxLength": 100, - "type": "string" - }, - "revenueRecognitionRuleName": { - "description": "The name of the revenue recognition rule governing the revenue schedule.\n", - "maxLength": 100, - "type": "string" - } - }, - "type": "object" - }, - "memoItemAmount": { - "description": "The amount of the credit memo item.\n\n**Note**: This field is not available if you set the `zuora-version` request header to `224.0` or later.\n", - "format": "double", - "type": "number" - }, - "productRatePlanChargeId": { - "description": "The ID of the product rate plan charge that the credit memo is created from.\n\n**Note**: This field is only available if you set the `zuora-version` request header to `257.0` or later.\n", - "type": "string" - }, - "quantity": { - "description": "The number of units for the credit memo item.\n", - "format": "double", - "type": "number" - }, - "serviceEndDate": { - "description": "The service end date of the credit memo item. If not specified, the effective end date of the corresponding product rate plan will be used.\n", - "format": "date", - "type": "string" - }, - "serviceStartDate": { - "description": "The service start date of the credit memo item. If not specified, the effective start date of the corresponding product rate plan will be used.\n", - "format": "date", - "type": "string" - } - }, - "required": [ - "chargeId", - "productRatePlanChargeId" - ], - "type": "object" - } - -Value: - { - "amount": null, - "chargeId": "402890555a87d7f5015a88c613c5001e", - "comment": "this is comment1", - "quantity": 1, - "serviceEndDate": "2018-10-17", - "serviceStartDate": "2017-10-17" - } - And Error at "/amount": Value is not nullable -Schema: - { - "description": "Custom fields of the Credit Memo Item object. The name of each custom field has the form \u003ccode\u003e*customField*__c\u003c/code\u003e. Custom field names are case sensitive. See [Manage Custom Fields](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Manage_Custom_Fields) for more information.\n" - } - -Value: - null - | Error at "/charges/1": doesn't match schema due to: Error at "/productRatePlanChargeId": property "productRatePlanChargeId" is missing -Schema: - { - "properties": { - "amount": { - "description": "The amount of the credit memo item.\n\n**Note**: This field is only available if you set the `zuora-version` request header to `224.0` or later.\n", - "format": "double", - "type": "number" - }, - "chargeId": { - "description": "The ID of the product rate plan charge that the credit memo is created from.\n\n**Note**: This field is not available if you set the `zuora-version` request header to `257.0` or later.\n", - "type": "string" - }, - "comment": { - "description": "Comments about the product rate plan charge.\n\n**Note**: This field is not available if you set the `zuora-version` request header to `257.0` or later.\n", - "maxLength": 255, - "type": "string" - }, - "description": { - "description": "The description of the product rate plan charge.\n\n**Note**: This field is only available if you set the `zuora-version` request header to `257.0` or later.\n", - "maxLength": 255, - "type": "string" - }, - "financeInformation": { - "description": "Container for the finance information related to the product rate plan charge associated with the credit memo.\n", - "properties": { - "deferredRevenueAccountingCode": { - "description": "The accounting code for the deferred revenue, such as Monthly Recurring Liability.\n", - "maxLength": 100, - "type": "string" - }, - "onAccountAccountingCode": { - "description": "The accounting code that maps to an on account in your accounting system.\n", - "maxLength": 100, - "type": "string" - }, - "recognizedRevenueAccountingCode": { - "description": "The accounting code for the recognized revenue, such as Monthly Recurring Charges or Overage Charges.\n", - "maxLength": 100, - "type": "string" - }, - "revenueRecognitionRuleName": { - "description": "The name of the revenue recognition rule governing the revenue schedule.\n", - "maxLength": 100, - "type": "string" - } - }, - "type": "object" - }, - "memoItemAmount": { - "description": "The amount of the credit memo item.\n\n**Note**: This field is not available if you set the `zuora-version` request header to `224.0` or later.\n", - "format": "double", - "type": "number" - }, - "productRatePlanChargeId": { - "description": "The ID of the product rate plan charge that the credit memo is created from.\n\n**Note**: This field is only available if you set the `zuora-version` request header to `257.0` or later.\n", - "type": "string" - }, - "quantity": { - "description": "The number of units for the credit memo item.\n", - "format": "double", - "type": "number" - }, - "serviceEndDate": { - "description": "The service end date of the credit memo item. If not specified, the effective end date of the corresponding product rate plan will be used.\n", - "format": "date", - "type": "string" - }, - "serviceStartDate": { - "description": "The service start date of the credit memo item. If not specified, the effective start date of the corresponding product rate plan will be used.\n", - "format": "date", - "type": "string" - } - }, - "required": [ - "chargeId", - "productRatePlanChargeId" - ], - "type": "object" - } - -Value: - { - "amount": 20, - "chargeId": "402890555a7d4022015a7d90906b0067", - "comment": "this is comment2", - "serviceEndDate": "2018-10-17", - "serviceStartDate": "2017-10-17" - } + "2017-03-02T00:00:00Z" From 32005a9a51d3a4d9aa6e8fd3e9d783fc126688f4 Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 14:23:11 +0300 Subject: [PATCH 08/31] Revert the apis-guru fixture churn Those 232 files changed because date-shaped scalars were decoding to time.Time -- the previous path disabled YAML 1.1 timestamp resolution via an option on our yaml fork, and stock go-yaml has none. Retagging such scalars before decoding reproduces that, so the fixtures should not move. --- ...rd_com_events_1_2_0_openapi_yaml__validate | 11 +- ..._com_CheckoutService_37_openapi_yaml__load | 2 +- ..._com_CheckoutService_40_openapi_yaml__load | 2 +- ..._com_CheckoutService_41_openapi_yaml__load | 2 +- ..._com_CheckoutService_46_openapi_yaml__load | 2 +- ..._com_CheckoutService_49_openapi_yaml__load | 2 +- ..._com_CheckoutService_50_openapi_yaml__load | 2 +- ..._com_CheckoutService_51_openapi_yaml__load | 2 +- ..._com_CheckoutService_52_openapi_yaml__load | 2 +- ..._com_CheckoutService_53_openapi_yaml__load | 2 +- ..._com_CheckoutService_64_openapi_yaml__load | 2 +- ..._com_CheckoutService_65_openapi_yaml__load | 2 +- ..._com_CheckoutService_66_openapi_yaml__load | 2 +- ..._com_CheckoutService_67_openapi_yaml__load | 2 +- ..._com_CheckoutService_68_openapi_yaml__load | 2 +- ..._com_CheckoutService_69_openapi_yaml__load | 2 +- ..._com_CheckoutService_70_openapi_yaml__load | 2 +- ..._CheckoutService_v71_71_openapi_yaml__load | 2 +- ...icationService_v1_1_openapi_yaml__validate | 61 +- ...ManagementService_1_openapi_yaml__validate | 37 +- ...agementService_v3_3_openapi_yaml__validate | 37 +- ...tificationService_4_openapi_yaml__validate | 11 +- ...tificationService_5_openapi_yaml__validate | 11 +- ...tificationService_6_openapi_yaml__validate | 11 +- ...n_com_PaymentService_25_openapi_yaml__load | 2 +- ...n_com_PaymentService_30_openapi_yaml__load | 2 +- ...n_com_PaymentService_40_openapi_yaml__load | 2 +- ...n_com_PaymentService_46_openapi_yaml__load | 2 +- ...n_com_PaymentService_49_openapi_yaml__load | 2 +- ...n_com_PaymentService_50_openapi_yaml__load | 2 +- ...n_com_PaymentService_51_openapi_yaml__load | 2 +- ...n_com_PaymentService_52_openapi_yaml__load | 2 +- ...n_com_PaymentService_64_openapi_yaml__load | 2 +- ...n_com_PaymentService_67_openapi_yaml__load | 2 +- ...n_com_PaymentService_68_openapi_yaml__load | 2 +- ...en_com_PayoutService_46_openapi_yaml__load | 2 +- ...en_com_PayoutService_49_openapi_yaml__load | 2 +- .../amadeus_com_2_2_0_openapi_yaml__validate | 29 +- ...rice_analysis_1_0_1_openapi_yaml__validate | 7 +- ...adeus_trip_parser_3_0_1_openapi_yaml__load | 2 +- ...hicle_enquiry_1_1_0_openapi_yaml__validate | 12 +- ...m_accounting_10_0_0_openapi_yaml__validate | 52 +- ...eck_com_hris_10_0_0_openapi_yaml__validate | 21 +- ...deck_com_pos_10_0_0_openapi_yaml__validate | 13 +- .../apis_guru_2_2_0_openapi_yaml__validate | 60 +- .../asana_com_1_0_openapi_yaml__validate | 12 +- .../ato_gov_au_0_0_6_openapi_yaml__validate | 13 +- .../box_com_2_0_0_openapi_yaml__validate | 301 +- .../bunq_com_1_0_openapi_yaml__load | 2 +- ...dat_io_accounting_2_1_0_openapi_yaml__load | 2 +- .../codat_io_assess_1_0_openapi_yaml__load | 3 +- ...io_bank_feeds_2_1_0_openapi_yaml__validate | 13 +- ...at_io_banking_2_1_0_openapi_yaml__validate | 7 +- ...o_sync_for_commerce_1_1_openapi_yaml__load | 3 +- ...c_for_expenses_prealpha_openapi_yaml__load | 3 +- .../dev_to_1_0_0_openapi_yaml__validate | 35 +- .../digitalnz_org_3_openapi_yaml__validate | 17 +- ...ker_com_engine_1_33_openapi_yaml__validate | 18 +- ...docker_com_hub_beta_openapi_yaml__validate | 9 +- .../docusign_net_v2_1_openapi_yaml__load | 2 +- .../dodo_ac_1_6_0_openapi_yaml__validate | 30 +- .../exavault_com_2_0_openapi_yaml__validate | 11 +- .../fec_gov_1_0_openapi_yaml__validate | 20 +- .../figshare_com_2_0_0_openapi_yaml__validate | 10 +- .../files_com_0_0_1_openapi_yaml__validate | 75 +- .../fire_com_1_0_openapi_yaml__validate | 8 +- .../flat_io_2_13_0_openapi_yaml__validate | 28 +- .../giphy_com_1_0_openapi_yaml__validate | 12 +- ...pi_github_com_1_1_4_openapi_yaml__validate | 8 +- ...om_2022_11_28_1_1_4_openapi_yaml__validate | 8 +- ...thub_com_ghec_1_1_4_openapi_yaml__validate | 11 +- ...ec_2022_11_28_1_1_4_openapi_yaml__validate | 11 +- ...com_ghes_2_18_1_1_4_openapi_yaml__validate | 8 +- ...com_ghes_2_19_1_1_4_openapi_yaml__validate | 8 +- ...com_ghes_2_20_1_1_4_openapi_yaml__validate | 8 +- ...com_ghes_2_21_1_1_4_openapi_yaml__validate | 8 +- ...com_ghes_2_22_1_1_4_openapi_yaml__validate | 7 +- ..._com_ghes_3_0_1_1_4_openapi_yaml__validate | 10 +- ..._com_ghes_3_1_1_1_4_openapi_yaml__validate | 10 +- ..._com_ghes_3_2_1_1_4_openapi_yaml__validate | 10 +- ..._com_ghes_3_3_1_1_4_openapi_yaml__validate | 10 +- ..._com_ghes_3_4_1_1_4_openapi_yaml__validate | 10 +- ..._com_ghes_3_5_1_1_4_openapi_yaml__validate | 10 +- ..._com_ghes_3_6_1_1_4_openapi_yaml__validate | 10 +- ..._com_ghes_3_7_1_1_4_openapi_yaml__validate | 11 +- ..._com_ghes_3_8_1_1_4_openapi_yaml__validate | 11 +- ...com_github_ae_1_1_4_openapi_yaml__validate | 10 +- ..._bc_ca_bcgnws_3_x_x_openapi_yaml__validate | 4 +- ...hetzner_cloud_1_0_0_openapi_yaml__validate | 14 +- ...stcodes_co_uk_3_7_0_openapi_yaml__validate | 10 +- .../increase_com_0_0_1_openapi_yaml__validate | 4111 ++++++++++++++++- ..._4+0_gb463b49_dirty_openapi_yaml__validate | 13 +- .../lgtm_com_v1_0_openapi_yaml__validate | 172 +- ...ailchimp_com_3_0_55_openapi_yaml__validate | 25 +- .../medium_com_1_0_openapi_yaml__validate | 10 +- ...com_0_0_0_streaming_openapi_yaml__validate | 30 +- ...ices_Prediction_3_0_openapi_yaml__validate | 12 +- ...rvices_Training_2_0_openapi_yaml__validate | 21 +- ...rvices_Training_2_1_openapi_yaml__validate | 21 +- ...rvices_Training_2_2_openapi_yaml__validate | 21 +- ...rvices_Training_3_0_openapi_yaml__validate | 23 +- ...rvices_Training_3_1_openapi_yaml__validate | 23 +- ...rvices_Training_3_2_openapi_yaml__validate | 23 +- ..._conversation_2_0_1_openapi_yaml__validate | 10 +- ...nversation_v2_1_0_1_openapi_yaml__validate | 6 +- ..._com_dispatch_0_3_4_openapi_yaml__validate | 15 +- ...sages_olympus_1_4_0_openapi_yaml__validate | 8 +- ...o_com_reports_2_2_2_openapi_yaml__validate | 12 +- ...m_subaccounts_1_0_8_openapi_yaml__validate | 9 +- .../notion_com_1_0_0_openapi_yaml__validate | 10 +- .../openuv_io_v1_openapi_yaml__validate | 12 +- ...andascore_co_2_23_1_openapi_yaml__validate | 344 +- .../pay1_de_link_v1_openapi_yaml__validate | 12 +- ...eratorapi_com_3_1_1_openapi_yaml__validate | 11 +- ...io_de_personnel_1_0_openapi_yaml__validate | 20 - ..._2020_09_14_1_345_1_openapi_yaml__validate | 315 +- ...pocketsmith_com_2_0_openapi_yaml__validate | 8 +- ...sassociation_io_2_0_openapi_yaml__validate | 6 +- .../probely_com_1_2_0_openapi_yaml__validate | 13 +- .../rebilly_com_2_1_openapi_yaml__validate | 13 +- .../rentcast_io_1_0_openapi_yaml__validate | 2 +- .../salesloft_com_v2_openapi_yaml__validate | 15 +- .../sendgrid_com_1_0_0_openapi_yaml__load | 2 +- ...om_1_1_202304191404_openapi_yaml__validate | 12 +- ...terstock_com_1_1_32_openapi_yaml__validate | 33 +- .../snyk_io_1_0_0_openapi_yaml__validate | 6 +- .../squareup_com_2_0_openapi_yaml__validate | 152 +- .../statsocial_com_1_0_0_openapi_yaml__load | 1 + .../telnyx_com_2_0_0_openapi_yaml__validate | 8 +- ...ehealth_com_v7_78_1_openapi_yaml__validate | 9 +- ...er_com_current_2_62_openapi_yaml__validate | 268 +- .../unicourt_com_1_0_0_openapi_yaml__validate | 14 +- ..._gov_benefits_1_0_0_openapi_yaml__validate | 11 +- .../va_gov_forms_0_0_0_openapi_yaml__validate | 12 +- .../vercel_com_0_0_1_openapi_yaml__load | 3 +- .../viator_com_1_0_0_openapi_yaml__validate | 219 +- ...ing_com_weather_4_6_openapi_yaml__validate | 6 +- ...e_com_reports_1_0_1_openapi_yaml__validate | 8 +- ...cal_Catalog_API_1_0_openapi_yaml__validate | 11 +- ...Seller_Portal_1_0_0_openapi_yaml__validate | 12 +- ...al_Checkout_API_1_0_openapi_yaml__validate | 11 +- ...omer_Credit_API_1_0_openapi_yaml__validate | 8 +- ...tplace_Protocol_1_0_openapi_yaml__validate | 7 +- ...ocal_Orders_API_1_0_openapi_yaml__validate | 6 +- ...I__PII_version__1_0_openapi_yaml__validate | 6 +- ...ptions_API__v2__1_0_openapi_yaml__validate | 24 +- ...lthreader_com_1_0_0_openapi_yaml__validate | 10 +- ...uora_com_2021_08_20_openapi_yaml__validate | 197 +- 148 files changed, 6283 insertions(+), 1395 deletions(-) create mode 100644 openapi3/testdata/apis_guru_openapi_directory/statsocial_com_1_0_0_openapi_yaml__load diff --git a/openapi3/testdata/apis_guru_openapi_directory/1password_com_events_1_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/1password_com_events_1_2_0_openapi_yaml__validate index 78f19e1b5..f39d8ab67 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/1password_com_events_1_2_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/1password_com_events_1_2_0_openapi_yaml__validate @@ -1,10 +1 @@ -invalid components: schema "AuditEvent": invalid example: unhandled value of type time.Time -Schema: - { - "example": "2020-06-11T16:32:50-03:00", - "format": "date-time", - "type": "string" - } - -Value: - "2020-06-11T16:32:50-03:00" +invalid components: request body "AuditEventsRequest": invalid example: example Continuing cursor: input matches more than one oneOf schemas diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_37_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_37_openapi_yaml__load index 600b4ea6a..902879ef1 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_37_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_37_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 4971: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 4971: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_40_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_40_openapi_yaml__load index 62c48deaa..01edf3ae1 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_40_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_40_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5279: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5279: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_41_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_41_openapi_yaml__load index f0e607f51..6c4628c14 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_41_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_41_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5364: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5364: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_46_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_46_openapi_yaml__load index cd68be2ac..253010369 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_46_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_46_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5365: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5365: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_49_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_49_openapi_yaml__load index 8128eb958..279a03b98 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_49_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_49_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5375: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5375: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_50_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_50_openapi_yaml__load index 906a6e29d..426e3b15b 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_50_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_50_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5433: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5433: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_51_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_51_openapi_yaml__load index e969d9153..097ec6932 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_51_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_51_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5435: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5435: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_52_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_52_openapi_yaml__load index a3a07f381..6c1420bd4 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_52_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_52_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5441: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5441: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_53_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_53_openapi_yaml__load index a3a07f381..6c1420bd4 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_53_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_53_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5441: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5441: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_64_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_64_openapi_yaml__load index a3a07f381..6c1420bd4 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_64_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_64_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5441: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5441: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_65_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_65_openapi_yaml__load index b6763b9db..4a31bfe54 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_65_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_65_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5456: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5456: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_66_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_66_openapi_yaml__load index b6763b9db..4a31bfe54 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_66_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_66_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5456: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5456: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_67_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_67_openapi_yaml__load index 8e2627520..e6fe6ddef 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_67_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_67_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5410: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5410: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_68_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_68_openapi_yaml__load index 7297a1030..c0210c8b9 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_68_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_68_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 4685: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 4685: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_69_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_69_openapi_yaml__load index 4d22dd9e4..c8c9e7e90 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_69_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_69_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 4730: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 4730: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_70_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_70_openapi_yaml__load index 5a419976b..a0b2b1c49 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_70_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_70_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 4776: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 4776: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_v71_71_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_v71_71_openapi_yaml__load index 827845a98..ba2850b0d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_v71_71_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_v71_71_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 4772: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 4772: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementNotificationService_v1_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementNotificationService_v1_1_openapi_yaml__validate index a1dea40b6..5b041fdc7 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementNotificationService_v1_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementNotificationService_v1_1_openapi_yaml__validate @@ -1,10 +1,63 @@ -invalid webhooks: webhook "merchant.created": invalid operation POST: invalid example: example merchant.created: Error at "/createdAt": unhandled value of type time.Time +invalid webhooks: webhook "merchant.updated": invalid operation POST: invalid example: example merchant-updated-with-errors: Error at "/data/capabilities/receivePayments/problems/0/verificationErrors/0/code": value must be a string Schema: { - "description": "Timestamp for when the webhook was created.", - "format": "date-time", + "description": "The verification error code.", "type": "string" } Value: - "2022-08-12T10:50:01+02:00" + 28064 + | Error at "/data/capabilities/receivePayments/problems/0/verificationErrors/0/remediatingActions/0/code": value must be a string +Schema: + { + "description": "The remediating action code.", + "type": "string" + } + +Value: + 2123 + | Error at "/data/capabilities/receivePayments/problems/0/verificationErrors/1/code": value must be a string +Schema: + { + "description": "The verification error code.", + "type": "string" + } + +Value: + 130 + | Error at "/data/capabilities/receivePayments/problems/0/verificationErrors/1/remediatingActions/0/code": value must be a string +Schema: + { + "description": "The remediating action code.", + "type": "string" + } + +Value: + 1300 + | Error at "/data/capabilities/receivePayments/problems/0/verificationErrors/1/subErrors/0/code": value must be a string +Schema: + { + "description": "The verification error code.", + "type": "string" + } + +Value: + 13000 + | Error at "/data/capabilities/receivePayments/problems/0/verificationErrors/1/subErrors/0/remediatingActions/0/code": value must be a string +Schema: + { + "description": "The remediating action code.", + "type": "string" + } + +Value: + 1300 + | Error at "/data/capabilities/receivePayments/problems/0/verificationErrors/1/subErrors/0/remediatingActions/1/code": value must be a string +Schema: + { + "description": "The remediating action code.", + "type": "string" + } + +Value: + 1301 diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementService_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementService_1_openapi_yaml__validate index 4a5c89b81..a66c7bdb6 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementService_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementService_1_openapi_yaml__validate @@ -1,40 +1,9 @@ -invalid paths: invalid path /companies/{companyId}/androidCertificates: invalid operation GET: invalid example: example success: Error at "/data/0/notAfter": unhandled value of type time.Time +invalid paths: invalid path /terminals/scheduleActions: invalid operation POST: invalid example: example verification-error: Error at "/errorCode": value must be a string Schema: { - "description": "The date when the certificate stops to be valid.", - "format": "date-time", + "description": "A code that identifies the problem type.", "type": "string" } Value: - "2038-04-12T00:00:00+02:00" - | Error at "/data/0/notBefore": unhandled value of type time.Time -Schema: - { - "description": "The date when the certificate starts to be valid.", - "format": "date-time", - "type": "string" - } - -Value: - "2008-04-20T00:00:00+02:00" - | Error at "/data/1/notAfter": unhandled value of type time.Time -Schema: - { - "description": "The date when the certificate stops to be valid.", - "format": "date-time", - "type": "string" - } - -Value: - "2048-04-12T00:00:00+02:00" - | Error at "/data/1/notBefore": unhandled value of type time.Time -Schema: - { - "description": "The date when the certificate starts to be valid.", - "format": "date-time", - "type": "string" - } - -Value: - "2008-04-20T00:00:00+02:00" + 1029 diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementService_v3_3_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementService_v3_3_openapi_yaml__validate index 4a5c89b81..a66c7bdb6 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementService_v3_3_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_ManagementService_v3_3_openapi_yaml__validate @@ -1,40 +1,9 @@ -invalid paths: invalid path /companies/{companyId}/androidCertificates: invalid operation GET: invalid example: example success: Error at "/data/0/notAfter": unhandled value of type time.Time +invalid paths: invalid path /terminals/scheduleActions: invalid operation POST: invalid example: example verification-error: Error at "/errorCode": value must be a string Schema: { - "description": "The date when the certificate stops to be valid.", - "format": "date-time", + "description": "A code that identifies the problem type.", "type": "string" } Value: - "2038-04-12T00:00:00+02:00" - | Error at "/data/0/notBefore": unhandled value of type time.Time -Schema: - { - "description": "The date when the certificate starts to be valid.", - "format": "date-time", - "type": "string" - } - -Value: - "2008-04-20T00:00:00+02:00" - | Error at "/data/1/notAfter": unhandled value of type time.Time -Schema: - { - "description": "The date when the certificate stops to be valid.", - "format": "date-time", - "type": "string" - } - -Value: - "2048-04-12T00:00:00+02:00" - | Error at "/data/1/notBefore": unhandled value of type time.Time -Schema: - { - "description": "The date when the certificate starts to be valid.", - "format": "date-time", - "type": "string" - } - -Value: - "2008-04-20T00:00:00+02:00" + 1029 diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_4_openapi_yaml__validate index 213bddfbd..3280c1b01 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_4_openapi_yaml__validate @@ -1,11 +1,6 @@ -invalid webhooks: webhook "/ACCOUNT_CLOSED": invalid operation POST: invalid example: example accountClosed: Error at "/eventDate": unhandled value of type time.Time +invalid webhooks: webhook "/ACCOUNT_CLOSED": invalid operation POST: invalid example: example accountClosed: validation failed due to: at '': got string, want object Schema: - { - "description": "The date and time when an event has been completed.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "4" - } + null Value: - "2019-01-01T01:00:00+01:00" + null diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_5_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_5_openapi_yaml__validate index 213bddfbd..3280c1b01 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_5_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_5_openapi_yaml__validate @@ -1,11 +1,6 @@ -invalid webhooks: webhook "/ACCOUNT_CLOSED": invalid operation POST: invalid example: example accountClosed: Error at "/eventDate": unhandled value of type time.Time +invalid webhooks: webhook "/ACCOUNT_CLOSED": invalid operation POST: invalid example: example accountClosed: validation failed due to: at '': got string, want object Schema: - { - "description": "The date and time when an event has been completed.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "4" - } + null Value: - "2019-01-01T01:00:00+01:00" + null diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_6_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_6_openapi_yaml__validate index 213bddfbd..3280c1b01 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_6_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_MarketPayNotificationService_6_openapi_yaml__validate @@ -1,11 +1,6 @@ -invalid webhooks: webhook "/ACCOUNT_CLOSED": invalid operation POST: invalid example: example accountClosed: Error at "/eventDate": unhandled value of type time.Time +invalid webhooks: webhook "/ACCOUNT_CLOSED": invalid operation POST: invalid example: example accountClosed: validation failed due to: at '': got string, want object Schema: - { - "description": "The date and time when an event has been completed.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "4" - } + null Value: - "2019-01-01T01:00:00+01:00" + null diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_25_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_25_openapi_yaml__load index d0ddc2d76..67d2323f8 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_25_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_25_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 964: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 964: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_30_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_30_openapi_yaml__load index a54c3ace2..14aaec114 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_30_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_30_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1158: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1158: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_40_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_40_openapi_yaml__load index 41d00cc98..238ecf375 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_40_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_40_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1562: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1562: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_46_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_46_openapi_yaml__load index 41d00cc98..238ecf375 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_46_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_46_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1562: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1562: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_49_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_49_openapi_yaml__load index 41d00cc98..238ecf375 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_49_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_49_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1562: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1562: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_50_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_50_openapi_yaml__load index 5a583a987..9ff4f6619 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_50_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_50_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1575: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1575: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_51_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_51_openapi_yaml__load index e4447e976..9cf7a1624 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_51_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_51_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1647: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1647: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_52_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_52_openapi_yaml__load index e4447e976..9cf7a1624 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_52_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_52_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1647: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1647: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_64_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_64_openapi_yaml__load index e4447e976..9cf7a1624 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_64_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_64_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1647: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1647: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_67_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_67_openapi_yaml__load index e4447e976..9cf7a1624 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_67_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_67_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1647: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1647: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_68_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_68_openapi_yaml__load index 508bf8a06..a113cdfeb 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_68_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_68_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1808: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1808: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_46_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_46_openapi_yaml__load index 325474a9d..36ba354c8 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_46_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_46_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 541: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 541: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_49_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_49_openapi_yaml__load index 325474a9d..36ba354c8 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_49_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_49_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 541: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 541: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_2_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_2_2_0_openapi_yaml__validate index 387ff5f84..d72346952 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_2_2_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_2_2_0_openapi_yaml__validate @@ -1,11 +1,28 @@ -invalid components: schema "DateTimeRange": invalid example: unhandled value of type time.Time +invalid components: schema "Error_400": invalid example: Error at "/errors/0/source": there must be at most 1 properties Schema: { - "description": "Dates are specified in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) YYYY-MM-DD format, e.g. 2018-12-25", - "example": "2018-09-22T00:00:00Z", - "format": "date", - "type": "string" + "description": "an object containing references to the source of the error", + "maxProperties": 1, + "properties": { + "example": { + "description": "a string indicating an example of the right value", + "type": "string" + }, + "parameter": { + "description": "a string indicating which URI query parameter caused the issue", + "type": "string" + }, + "pointer": { + "description": "a JSON Pointer [RFC6901] to the associated entity in the request document", + "type": "string" + } + }, + "title": "Issue_Source", + "type": "object" } Value: - "2018-09-22T00:00:00Z" + { + "example": "CDG", + "parameter": "airport" + } diff --git a/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_amadeus_flight_price_analysis_1_0_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_amadeus_flight_price_analysis_1_0_1_openapi_yaml__validate index a99a5833b..0df4e457c 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_amadeus_flight_price_analysis_1_0_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_amadeus_flight_price_analysis_1_0_1_openapi_yaml__validate @@ -1,8 +1,9 @@ -invalid paths: invalid path /analytics/itinerary-price-metrics: invalid operation GET: invalid example: unhandled value of type time.Time +invalid paths: invalid path /analytics/itinerary-price-metrics: invalid operation GET: parameter "oneWay" schema is invalid: invalid default: value must be a boolean Schema: { - "type": "string" + "default": "false", + "type": "boolean" } Value: - "2021-03-21T00:00:00Z" + "false" diff --git a/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_amadeus_trip_parser_3_0_1_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_amadeus_trip_parser_3_0_1_openapi_yaml__load index 9600eeaf7..10b861a73 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_amadeus_trip_parser_3_0_1_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_amadeus_trip_parser_3_0_1_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 275: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 275: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/api_gov_uk_vehicle_enquiry_1_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/api_gov_uk_vehicle_enquiry_1_1_0_openapi_yaml__validate index 4b60ad6bd..eedccb65a 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/api_gov_uk_vehicle_enquiry_1_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/api_gov_uk_vehicle_enquiry_1_1_0_openapi_yaml__validate @@ -1,11 +1 @@ -invalid components: schema "Vehicle": invalid example: unhandled value of type time.Time -Schema: - { - "description": "Additional Rate of Tax End Date, format: YYYY-MM-DD", - "example": "2007-12-25T00:00:00Z", - "format": "date", - "type": "string" - } - -Value: - "2007-12-25T00:00:00Z" +invalid components: schema "Vehicle": invalid example: string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_accounting_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_accounting_10_0_0_openapi_yaml__validate index e49edbe06..25cc35b55 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_accounting_10_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_accounting_10_0_0_openapi_yaml__validate @@ -1,14 +1,48 @@ -invalid components: schema "AccountingCustomer": invalid example: unhandled value of type time.Time +invalid components: schema "GetProfitAndLossResponse": invalid anyOf element: invalid example: Error at "/type": property "type" is missing Schema: { - "description": "The date and time when the object was created.", - "example": "2020-09-30T07:43:32Z", - "format": "date-time", - "nullable": true, - "readOnly": true, - "title": "Created at (timestamp)", - "type": "string" + "example": { + "total": 200000 + }, + "properties": { + "id": { + "example": "123abc", + "nullable": true, + "type": "string" + }, + "records": { + "$ref": "#/components/schemas/ProfitAndLossRecords" + }, + "title": { + "example": "Income", + "nullable": true, + "type": "string" + }, + "total": { + "example": 23992.34, + "nullable": true, + "type": "number" + }, + "type": { + "example": "Section", + "type": "string" + } + }, + "required": [ + "type" + ], + "type": "object", + "x-apideck-schema-id": "ProfitAndLossSection", + "x-apideck-weights": { + "id": "medium", + "records": "medium", + "title": "medium", + "total": "medium", + "type": "critical" + } } Value: - "2020-09-30T07:43:32Z" + { + "total": 200000 + } diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_hris_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_hris_10_0_0_openapi_yaml__validate index c230b11ec..b96310bbb 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_hris_10_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_hris_10_0_0_openapi_yaml__validate @@ -1,13 +1,20 @@ -invalid components: schema "Birthday": invalid example: unhandled value of type time.Time +invalid components: schema "Employee": invalid example: value is not one of the allowed values ["weekly","biweekly","monthly","pro-rata","other"] Schema: { - "description": "The date of birth of the person.", - "example": "2000-08-12T00:00:00Z", - "format": "date", + "description": "Frequency of employee compensation.", + "enum": [ + "weekly", + "biweekly", + "monthly", + "pro-rata", + "other" + ], + "example": "year", "nullable": true, - "title": "Birth Date", - "type": "string" + "title": "Payment Frequency", + "type": "string", + "x-apideck-enum-id": "payment_frequency" } Value: - "2000-08-12T00:00:00Z" + "year" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_pos_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_pos_10_0_0_openapi_yaml__validate index 505169060..1600748db 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_pos_10_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_pos_10_0_0_openapi_yaml__validate @@ -1,14 +1,11 @@ -invalid components: schema "CreatedAt": invalid example: unhandled value of type time.Time +invalid components: schema "GetOrderResponse": invalid example: value must be an integer Schema: { - "description": "The date and time when the object was created.", - "example": "2020-09-30T07:43:32Z", - "format": "date-time", + "example": 27.5, "nullable": true, - "readOnly": true, - "title": "Created at (timestamp)", - "type": "string" + "title": "Total amount (in cents)", + "type": "integer" } Value: - "2020-09-30T07:43:32Z" + 27.5 diff --git a/openapi3/testdata/apis_guru_openapi_directory/apis_guru_2_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apis_guru_2_2_0_openapi_yaml__validate index cae4b1f85..1c27e7e18 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/apis_guru_2_2_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/apis_guru_2_2_0_openapi_yaml__validate @@ -1,34 +1,4 @@ -invalid components: schema "APIs": invalid example: Error at "/googleapis.com:drive/added": unhandled value of type time.Time -Schema: - { - "description": "Timestamp when the API was first added to the directory", - "format": "date-time", - "type": "string" - } - -Value: - "2015-02-22T20:00:45Z" - | Error at "/googleapis.com:drive/versions/v2/added": unhandled value of type time.Time -Schema: - { - "description": "Timestamp when the version was added", - "format": "date-time", - "type": "string" - } - -Value: - "2015-02-22T20:00:45Z" - | Error at "/googleapis.com:drive/versions/v2/updated": unhandled value of type time.Time -Schema: - { - "description": "Timestamp when the version was updated", - "format": "date-time", - "type": "string" - } - -Value: - "2016-06-17T00:21:44Z" - | Error at "/googleapis.com:drive/versions/v2/openapiVer": property "openapiVer" is missing +invalid components: schema "APIs": invalid example: Error at "/googleapis.com:drive/versions/v2/openapiVer": property "openapiVer" is missing Schema: { "additionalProperties": false, @@ -86,7 +56,7 @@ Schema: Value: { - "added": "2015-02-22T20:00:45Z", + "added": "2015-02-22T20:00:45.000Z", "info": { "title": "Drive", "version": "v2", @@ -107,28 +77,8 @@ Value: }, "swaggerUrl": "https://api.apis.guru/v2/specs/googleapis.com/drive/v2/swagger.json", "swaggerYamlUrl": "https://api.apis.guru/v2/specs/googleapis.com/drive/v2/swagger.yaml", - "updated": "2016-06-17T00:21:44Z" - } - | Error at "/googleapis.com:drive/versions/v3/added": unhandled value of type time.Time -Schema: - { - "description": "Timestamp when the version was added", - "format": "date-time", - "type": "string" - } - -Value: - "2015-12-12T00:25:13Z" - | Error at "/googleapis.com:drive/versions/v3/updated": unhandled value of type time.Time -Schema: - { - "description": "Timestamp when the version was updated", - "format": "date-time", - "type": "string" + "updated": "2016-06-17T00:21:44.000Z" } - -Value: - "2016-06-17T00:21:44Z" | Error at "/googleapis.com:drive/versions/v3/openapiVer": property "openapiVer" is missing Schema: { @@ -187,7 +137,7 @@ Schema: Value: { - "added": "2015-12-12T00:25:13Z", + "added": "2015-12-12T00:25:13.000Z", "info": { "title": "Drive", "version": "v3", @@ -208,5 +158,5 @@ Value: }, "swaggerUrl": "https://api.apis.guru/v2/specs/googleapis.com/drive/v3/swagger.json", "swaggerYamlUrl": "https://api.apis.guru/v2/specs/googleapis.com/drive/v3/swagger.yaml", - "updated": "2016-06-17T00:21:44Z" + "updated": "2016-06-17T00:21:44.000Z" } diff --git a/openapi3/testdata/apis_guru_openapi_directory/asana_com_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/asana_com_1_0_openapi_yaml__validate index 6efb7ab0d..7e4988301 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/asana_com_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/asana_com_1_0_openapi_yaml__validate @@ -1,12 +1,10 @@ -invalid components: schema "AttachmentResponse": invalid allOf element: invalid example: unhandled value of type time.Time +invalid components: schema "BatchRequest": invalid example: value must be an integer Schema: { - "description": "The time at which this resource was created.", - "example": "2012-02-22T02:06:58.147Z", - "format": "date-time", - "readOnly": true, - "type": "string" + "description": "Pagination offset for the request.", + "example": "eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9", + "type": "integer" } Value: - "2012-02-22T02:06:58.147Z" + "eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9" diff --git a/openapi3/testdata/apis_guru_openapi_directory/ato_gov_au_0_0_6_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/ato_gov_au_0_0_6_openapi_yaml__validate index b779bf0b9..798fb4a98 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/ato_gov_au_0_0_6_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/ato_gov_au_0_0_6_openapi_yaml__validate @@ -1,12 +1 @@ -invalid components: schema "address": invalid example: unhandled value of type time.Time -Schema: - { - "description": "The date and time the resource became active in the format defined by [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601).", - "example": "1979-01-13T09:05:06+10:00", - "format": "date-time", - "readOnly": true, - "type": "string" - } - -Value: - "1979-01-13T09:05:06+10:00" +invalid components: schema "address": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/box_com_2_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/box_com_2_0_0_openapi_yaml__validate index 7f5d659e6..0a626941a 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/box_com_2_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/box_com_2_0_0_openapi_yaml__validate @@ -1,11 +1,300 @@ -invalid components: schema "Collaboration": invalid example: unhandled value of type time.Time +invalid paths: invalid path /files/{file_id}#add_shared_link: invalid operation PUT: invalid example: example default: doesn't match schema due to: doesn't match schema due to: Error at "/sequence_id": property "sequence_id" is missing Schema: { - "description": "When the `status` of the collaboration object changed to\n`accepted` or `rejected`.", - "example": "2012-12-12T10:55:20-08:00", - "format": "date-time", - "type": "string" + "allOf": [ + { + "$ref": "#/components/schemas/File--Base" + }, + { + "properties": { + "file_version": { + "allOf": [ + { + "$ref": "#/components/schemas/FileVersion--Mini" + }, + { + "description": "The information about the current version of the file." + } + ] + }, + "name": { + "description": "The name of the file", + "example": "Contract.pdf", + "type": "string" + }, + "sequence_id": { + "allOf": [ + { + "description": "A numeric identifier that represents the most recent user event\nthat has been applied to this item.\n\nThis can be used in combination with the `GET /events`-endpoint\nto filter out user events that would have occurred before this\nidentifier was read.\n\nAn example would be where a Box Drive-like application\nwould fetch an item via the API, and then listen to incoming\nuser events for changes to the item. The application would\nignore any user events where the `sequence_id` in the event\nis smaller than or equal to the `sequence_id` in the originally\nfetched resource.", + "example": "3", + "type": "string" + }, + {} + ] + }, + "sha1": { + "description": "The SHA1 hash of the file. This can be used to compare the contents\nof a file on Box with a local file.", + "example": "85136C79CBF9FE36BB9D05D0639C70C265C18D37", + "format": "digest", + "type": "string" + } + } + } + ], + "description": "A mini representation of a file, used when\nnested under another resource.", + "required": [ + "sequence_id", + "sha1" + ], + "title": "File (Mini)", + "type": "object", + "x-box-resource-id": "file--mini", + "x-box-variant": "mini" } Value: - "2012-12-12T10:55:20-08:00" + { + "etag": "1", + "id": "12345", + "shared_link": { + "access": "open", + "download_count": 0, + "download_url": "https://app.box.com/shared/static/kwio6b4ovt1264rnfbyqo1.pdf", + "effective_access": "open", + "effective_permission": "can_download", + "is_password_enabled": false, + "permissions": { + "can_download": true, + "can_edit": true, + "can_preview": true + }, + "preview_count": 0, + "unshared_at": "2020-09-21T10:34:41-07:00", + "url": "https://app.box.com/s/kwio6b4ovt1264rnfbyqo1", + "vanity_name": null, + "vanity_url": null + }, + "type": "file" + } + | Error at "/sha1": property "sha1" is missing +Schema: + { + "allOf": [ + { + "$ref": "#/components/schemas/File--Base" + }, + { + "properties": { + "file_version": { + "allOf": [ + { + "$ref": "#/components/schemas/FileVersion--Mini" + }, + { + "description": "The information about the current version of the file." + } + ] + }, + "name": { + "description": "The name of the file", + "example": "Contract.pdf", + "type": "string" + }, + "sequence_id": { + "allOf": [ + { + "description": "A numeric identifier that represents the most recent user event\nthat has been applied to this item.\n\nThis can be used in combination with the `GET /events`-endpoint\nto filter out user events that would have occurred before this\nidentifier was read.\n\nAn example would be where a Box Drive-like application\nwould fetch an item via the API, and then listen to incoming\nuser events for changes to the item. The application would\nignore any user events where the `sequence_id` in the event\nis smaller than or equal to the `sequence_id` in the originally\nfetched resource.", + "example": "3", + "type": "string" + }, + {} + ] + }, + "sha1": { + "description": "The SHA1 hash of the file. This can be used to compare the contents\nof a file on Box with a local file.", + "example": "85136C79CBF9FE36BB9D05D0639C70C265C18D37", + "format": "digest", + "type": "string" + } + } + } + ], + "description": "A mini representation of a file, used when\nnested under another resource.", + "required": [ + "sequence_id", + "sha1" + ], + "title": "File (Mini)", + "type": "object", + "x-box-resource-id": "file--mini", + "x-box-variant": "mini" + } + +Value: + { + "etag": "1", + "id": "12345", + "shared_link": { + "access": "open", + "download_count": 0, + "download_url": "https://app.box.com/shared/static/kwio6b4ovt1264rnfbyqo1.pdf", + "effective_access": "open", + "effective_permission": "can_download", + "is_password_enabled": false, + "permissions": { + "can_download": true, + "can_edit": true, + "can_preview": true + }, + "preview_count": 0, + "unshared_at": "2020-09-21T10:34:41-07:00", + "url": "https://app.box.com/s/kwio6b4ovt1264rnfbyqo1", + "vanity_name": null, + "vanity_url": null + }, + "type": "file" + } + And Error at "/shared_link": doesn't match schema due to: Error at "/accessed": property "accessed" is missing +Schema: + { + "description": "Shared links provide direct, read-only access to files or folder on Box.\n\nShared links with open access level allow anyone with the URL\nto access the item, while shared links with company or collaborators access\nlevels can only be accessed by appropriately authenticated Box users.", + "properties": { + "access": { + "description": "The access level for this shared link.\n\n* `open` - provides access to this item to anyone with this link\n* `company` - only provides access to this item to people the same company\n* `collaborators` - only provides access to this item to people who are\n collaborators on this item\n\nIf this field is omitted when creating the shared link, the access level\nwill be set to the default access level specified by the enterprise admin.", + "enum": [ + "open", + "company", + "collaborators" + ], + "example": "open", + "type": "string" + }, + "download_count": { + "description": "The number of times this item has been downloaded.", + "example": 3, + "type": "integer" + }, + "download_url": { + "description": "A URL that can be used to download the file. This URL can be used in\na browser to download the file. This URL includes the file\nextension so that the file will be saved with the right file type.\n\nThis property will be `null` for folders.", + "example": "https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg", + "format": "url", + "nullable": true, + "type": "string", + "x-box-premium-feature": true + }, + "effective_access": { + "description": "The effective access level for the shared link. This can be a more\nrestrictive access level than the value in the `access` field when the\nenterprise settings restrict the allowed access levels.", + "enum": [ + "open", + "company", + "collaborators" + ], + "example": "company", + "type": "string" + }, + "effective_permission": { + "description": "The effective permissions for this shared link.\nThese result in the more restrictive combination of\nthe share link permissions and the item permissions set\nby the administrator, the owner, and any ancestor item\nsuch as a folder.", + "enum": [ + "can_edit", + "can_download", + "can_preview", + "no_access" + ], + "example": "can_download", + "type": "string" + }, + "is_password_enabled": { + "description": "Defines if the shared link requires a password to access the item.", + "example": true, + "type": "boolean" + }, + "permissions": { + "description": "Defines if this link allows a user to preview, edit, and download an item.\nThese permissions refer to the shared link only and\ndo not supersede permissions applied to the item itself.", + "properties": { + "can_download": { + "description": "Defines if the shared link allows for the item to be downloaded. For\nshared links on folders, this also applies to any items in the folder.\n\nThis value can be set to `true` when the effective access level is\nset to `open` or `company`, not `collaborators`.", + "example": true, + "type": "boolean" + }, + "can_edit": { + "description": "Defines if the shared link allows for the item to be edited.\n\nThis value can only be `true` if `can_download` is also `true` and if\nthe item has a type of `file`.", + "example": false, + "type": "boolean" + }, + "can_preview": { + "description": "Defines if the shared link allows for the item to be previewed.\n\nThis value is always `true`. For shared links on folders this also\napplies to any items in the folder.", + "example": true, + "type": "boolean" + } + }, + "required": [ + "can_download", + "can_preview", + "can_edit" + ], + "type": "object" + }, + "preview_count": { + "description": "The number of times this item has been previewed.", + "example": 3, + "type": "integer" + }, + "unshared_at": { + "description": "The date and time when this link will be unshared. This field can only be\nset by users with paid accounts.", + "example": "2018-04-13T13:53:23-07:00", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "url": { + "description": "The URL that can be used to access the item on Box.\n\nThis URL will display the item in Box's preview UI where the file\ncan be downloaded if allowed.\n\nThis URL will continue to work even when a custom `vanity_url`\nhas been set for this shared link.", + "example": "https://www.box.com/s/vspke7y05sb214wjokpk", + "format": "url", + "type": "string" + }, + "vanity_name": { + "description": "The custom name of a shared link, as used in the `vanity_url` field.", + "example": "my_url", + "nullable": true, + "type": "string" + }, + "vanity_url": { + "description": "The \"Custom URL\" that can also be used to preview the item on Box. Custom\nURLs can only be created or modified in the Box Web application.", + "example": "https://acme.app.box.com/v/my_url/", + "format": "url", + "nullable": true, + "type": "string" + } + }, + "required": [ + "url", + "accessed", + "effective_access", + "effective_permission", + "is_password_enabled", + "download_count", + "preview_count" + ], + "title": "Shared link", + "type": "object" + } + +Value: + { + "access": "open", + "download_count": 0, + "download_url": "https://app.box.com/shared/static/kwio6b4ovt1264rnfbyqo1.pdf", + "effective_access": "open", + "effective_permission": "can_download", + "is_password_enabled": false, + "permissions": { + "can_download": true, + "can_edit": true, + "can_preview": true + }, + "preview_count": 0, + "unshared_at": "2020-09-21T10:34:41-07:00", + "url": "https://app.box.com/s/kwio6b4ovt1264rnfbyqo1", + "vanity_name": null, + "vanity_url": null + } diff --git a/openapi3/testdata/apis_guru_openapi_directory/bunq_com_1_0_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/bunq_com_1_0_openapi_yaml__load index 44519b11a..d065d5a33 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/bunq_com_1_0_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/bunq_com_1_0_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1142: did not find expected key +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1142: did not find expected key diff --git a/openapi3/testdata/apis_guru_openapi_directory/codat_io_accounting_2_1_0_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/codat_io_accounting_2_1_0_openapi_yaml__load index 429dfa06b..711e7ca6c 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/codat_io_accounting_2_1_0_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/codat_io_accounting_2_1_0_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 43981: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 43981: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/codat_io_assess_1_0_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/codat_io_assess_1_0_openapi_yaml__load index 11379f886..7f6544a0b 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/codat_io_assess_1_0_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/codat_io_assess_1_0_openapi_yaml__load @@ -1,2 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: unmarshal errors: - line 4692: cannot unmarshal !!map into []interface {} +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal object into field Schema.examples of type []interface {} diff --git a/openapi3/testdata/apis_guru_openapi_directory/codat_io_bank_feeds_2_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/codat_io_bank_feeds_2_1_0_openapi_yaml__validate index 8360d314c..a07531e10 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/codat_io_bank_feeds_2_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/codat_io_bank_feeds_2_1_0_openapi_yaml__validate @@ -1,12 +1 @@ -invalid components: schema "BankFeedAccount": invalid example: unhandled value of type time.Time -Schema: - { - "description": "In Codat's data model, dates and times are represented using the \u003ca class=\"external\" href=\"https://en.wikipedia.org/wiki/ISO_8601\" target=\"_blank\"\u003eISO 8601 standard\u003c/a\u003e. Date and time fields are formatted as strings; for example:\n\n```\n2020-10-08T22:40:50Z\n2021-01-01T00:00:00\n```\n\n\n\nWhen syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:\n\n- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`\n- Unqualified local time: `2021-11-15T01:00:00`\n- UTC time offsets: `2021-11-15T01:00:00-05:00`\n\n\u003e Time zones\n\u003e \n\u003e Not all dates from Codat will contain information about time zones. \n\u003e Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced.", - "example": "2022-10-23T00:00:00Z", - "nullable": true, - "title": "Date time", - "type": "string" - } - -Value: - "2022-10-23T00:00:00Z" +invalid components: schema "BankTransactions": extra sibling fields: [definitions] diff --git a/openapi3/testdata/apis_guru_openapi_directory/codat_io_banking_2_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/codat_io_banking_2_1_0_openapi_yaml__validate index b39c02260..9cff992a4 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/codat_io_banking_2_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/codat_io_banking_2_1_0_openapi_yaml__validate @@ -1,6 +1 @@ -invalid components: schema "Account": invalid allOf element: invalid example: validation failed due to: at '': invalid jsonType time.Time -Schema: - null - -Value: - null +invalid components: schema "Account": extra sibling fields: [definitions] diff --git a/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_commerce_1_1_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_commerce_1_1_openapi_yaml__load index c34de6b50..2a6522f53 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_commerce_1_1_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_commerce_1_1_openapi_yaml__load @@ -1,2 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: unmarshal errors: - line 751: cannot unmarshal !!bool `false` into openapi3.SchemaBis +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal bool into field Schema.properties of type openapi3.Schema diff --git a/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_expenses_prealpha_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_expenses_prealpha_openapi_yaml__load index 846fbcea7..2a6522f53 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_expenses_prealpha_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_expenses_prealpha_openapi_yaml__load @@ -1,2 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: unmarshal errors: - line 766: cannot unmarshal !!bool `false` into openapi3.SchemaBis +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal bool into field Schema.properties of type openapi3.Schema diff --git a/openapi3/testdata/apis_guru_openapi_directory/dev_to_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/dev_to_1_0_0_openapi_yaml__validate index 7e72b5096..0c9d736e5 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/dev_to_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/dev_to_1_0_0_openapi_yaml__validate @@ -1,37 +1,8 @@ -invalid paths: invalid path /api/articles: invalid operation GET: invalid example: Error at "/0/created_at": unhandled value of type time.Time +invalid paths: invalid path /api/comments/{id}: invalid operation GET: invalid example: value must be an integer Schema: { - "format": "date-time", - "type": "string" + "type": "integer" } Value: - "2023-04-07T11:16:58Z" - | Error at "/0/last_comment_at": unhandled value of type time.Time -Schema: - { - "format": "date-time", - "type": "string" - } - -Value: - "2023-04-07T11:16:58Z" - | Error at "/0/published_at": unhandled value of type time.Time -Schema: - { - "format": "date-time", - "type": "string" - } - -Value: - "2023-04-07T11:16:58Z" - | Error at "/0/published_timestamp": unhandled value of type time.Time -Schema: - { - "description": "Crossposting or published date time", - "format": "date-time", - "type": "string" - } - -Value: - "2023-04-07T11:16:58Z" + "321" diff --git a/openapi3/testdata/apis_guru_openapi_directory/digitalnz_org_3_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/digitalnz_org_3_openapi_yaml__validate index a9786f343..0391e9703 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/digitalnz_org_3_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/digitalnz_org_3_openapi_yaml__validate @@ -1,14 +1,13 @@ -invalid components: schema "record": invalid example: unhandled value of type time.Time +invalid components: schema "record": invalid example: value must be an array Schema: { - "description": "The date the record was initially harvested into DigitalNZ.", - "example": "2012-04-21T05:32:02+13:00", - "format": "date-time", - "type": "string", - "xml": { - "name": "created-at" - } + "description": "Date information associated with this record (e.g. 1996-01-01T00:00:00.000Z). This field may be empty.", + "example": "1996-01-01T00:00:00.000Z", + "items": { + "type": "string" + }, + "type": "array" } Value: - "2012-04-21T05:32:02+13:00" + "1996-01-01T00:00:00.000Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/docker_com_engine_1_33_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/docker_com_engine_1_33_openapi_yaml__validate index 5e7eba9c8..64ed3a5f5 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/docker_com_engine_1_33_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/docker_com_engine_1_33_openapi_yaml__validate @@ -1,11 +1,17 @@ -invalid components: schema "ClusterInfo": invalid example: unhandled value of type time.Time +invalid components: schema "Network": invalid example: Error at "/IPAM/Options": value must be an array Schema: { - "description": "Date and time at which the swarm was initialised in\n[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.\n", - "example": "2016-08-18T10:44:24.496525531Z", - "format": "dateTime", - "type": "string" + "description": "Driver-specific options, specified as a map.", + "items": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "type": "array" } Value: - "2016-08-18T10:44:24.496525531Z" + { + "foo": "bar" + } diff --git a/openapi3/testdata/apis_guru_openapi_directory/docker_com_hub_beta_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/docker_com_hub_beta_openapi_yaml__validate index 15882b684..827224a93 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/docker_com_hub_beta_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/docker_com_hub_beta_openapi_yaml__validate @@ -1,11 +1,10 @@ -invalid components: schema "GetNamespaceRepositoryImagesResponse": invalid example: unhandled value of type time.Time +invalid components: schema "Users2FALoginRequest": invalid example: value must be a string Schema: { - "description": "Time when this image was last pulled. Note this is updated at most once per hour.", - "example": "2021-02-24T23:16:10.200008Z", - "nullable": true, + "description": "The Time-based One-Time Password of the Docker Hub account to authenticate with.", + "example": 123456, "type": "string" } Value: - "2021-02-24T23:16:10.200008Z" + 123456 diff --git a/openapi3/testdata/apis_guru_openapi_directory/docusign_net_v2_1_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/docusign_net_v2_1_openapi_yaml__load index f6be00efb..e5fb18fb8 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/docusign_net_v2_1_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/docusign_net_v2_1_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: control characters are not allowed +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: control characters are not allowed diff --git a/openapi3/testdata/apis_guru_openapi_directory/dodo_ac_1_6_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/dodo_ac_1_6_0_openapi_yaml__validate index f363a1ca1..60805961a 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/dodo_ac_1_6_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/dodo_ac_1_6_0_openapi_yaml__validate @@ -1,10 +1,32 @@ -invalid components: schema "NHEvent": invalid example: unhandled value of type time.Time +invalid components: schema "NHInterior": invalid example: value is not one of the allowed values ["Aqua","Beige","Black","Blue","Brown","Colorful","Gray","Green","Orange","Pink","Purple","Red","White","Yellow"] Schema: { - "description": "The date of the event in YYYY-MM-DD format.", - "example": "2021-05-01T00:00:00Z", + "description": "(WIP)", + "enum": [ + "Aqua", + "Beige", + "Black", + "Blue", + "Brown", + "Colorful", + "Gray", + "Green", + "Orange", + "Pink", + "Purple", + "Red", + "White", + "Yellow" + ], + "example": [ + "White", + "Colorful" + ], "type": "string" } Value: - "2021-05-01T00:00:00Z" + [ + "White", + "Colorful" + ] diff --git a/openapi3/testdata/apis_guru_openapi_directory/exavault_com_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/exavault_com_2_0_openapi_yaml__validate index 65cbb07d2..d02359ba1 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/exavault_com_2_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/exavault_com_2_0_openapi_yaml__validate @@ -1,11 +1,10 @@ -invalid components: schema "Account": invalid example: unhandled value of type time.Time +invalid components: schema "Error": invalid example: value must be an object Schema: { - "description": "Timestamp of account creation.", - "example": "2017-01-12T09:06:21Z", - "format": "date-time", - "type": "string" + "description": "Meta object containing non-standard meta-information about the error.", + "example": "\u003c_META_OBJECT\u003e", + "type": "object" } Value: - "2017-01-12T09:06:21Z" + "\u003c_META_OBJECT\u003e" diff --git a/openapi3/testdata/apis_guru_openapi_directory/fec_gov_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/fec_gov_1_0_openapi_yaml__validate index 344183a6c..e862e0bd1 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/fec_gov_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/fec_gov_1_0_openapi_yaml__validate @@ -1,22 +1,4 @@ -invalid paths: invalid path /legal/search/: invalid operation GET: invalid example: Error at "/advisory_opinions/0/documents/0/date": string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" | Error at "/advisory_opinions/0/issue_date": unhandled value of type time.Time -Schema: - { - "format": "date", - "type": "string" - } - -Value: - "2012-06-21T00:00:00Z" - | Error at "/advisory_opinions/0/request_date": unhandled value of type time.Time -Schema: - { - "format": "date", - "type": "string" - } - -Value: - "2012-05-14T00:00:00Z" - | Error at "/murs/0/close_date": string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" | Error at "/murs/0/commission_votes/0/vote_date": string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" | Error at "/murs/0/commission_votes/1/vote_date": string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" | Error at "/murs/0/dispositions/0/penalty": Value is not nullable +invalid paths: invalid path /legal/search/: invalid operation GET: invalid example: Error at "/advisory_opinions/0/documents/0/date": string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" | Error at "/murs/0/close_date": string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" | Error at "/murs/0/commission_votes/0/vote_date": string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" | Error at "/murs/0/commission_votes/1/vote_date": string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" | Error at "/murs/0/dispositions/0/penalty": Value is not nullable Schema: { "type": "number" diff --git a/openapi3/testdata/apis_guru_openapi_directory/figshare_com_2_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/figshare_com_2_0_0_openapi_yaml__validate index 4d1248357..365749d50 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/figshare_com_2_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/figshare_com_2_0_0_openapi_yaml__validate @@ -1,10 +1,10 @@ -invalid components: schema "AccountReport": invalid example: unhandled value of type time.Time +invalid components: schema "ArticleComplete": invalid example: value must be a boolean Schema: { - "description": "Date when the AccountReport was requested", - "example": "2017-05-15T15:12:26Z", - "type": "string" + "description": "True if author has published items", + "example": 1, + "type": "boolean" } Value: - "2017-05-15T15:12:26Z" + 1 diff --git a/openapi3/testdata/apis_guru_openapi_directory/files_com_0_0_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/files_com_0_0_1_openapi_yaml__validate index d7f13e8ac..557a98c05 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/files_com_0_0_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/files_com_0_0_1_openapi_yaml__validate @@ -1,11 +1,74 @@ -invalid components: schema "AccountLineItemEntity": invalid example: unhandled value of type time.Time +invalid components: schema "AccountLineItemEntity": invalid example: Error at "/0": Value is not nullable Schema: { - "description": "Line item created at", - "example": "2000-01-01T01:00:00Z", - "format": "date-time", - "type": "string" + "properties": { + "amount": { + "description": "Invoice line item amount", + "example": 1, + "format": "double", + "type": "number" + }, + "created_at": { + "description": "Invoice line item created at date/time", + "example": "2000-01-01T01:00:00Z", + "format": "date-time", + "type": "string" + }, + "description": { + "description": "Invoice line item description", + "example": "Service from 2019-01-01 through 2019-12-31", + "type": "string" + }, + "plan": { + "description": "Plan name", + "example": "Premier", + "type": "string" + }, + "service_end_at": { + "description": "Invoice line item service end date/time", + "example": "2000-01-01T01:00:00Z", + "format": "date-time", + "type": "string" + }, + "service_start_at": { + "description": "Invoice line item service start date/time", + "example": "2000-01-01T01:00:00Z", + "format": "date-time", + "type": "string" + }, + "site": { + "description": "Site name", + "example": "My site", + "type": "string" + }, + "type": { + "description": "Invoice line item type", + "enum": [ + "invoice", + "invoice_adjustment", + "usage_overage", + "user_overage", + "addon_subscription", + "misc_fee", + "usage_overage_adjustment", + "user_overage_adjustment", + "addon_subscription_adjustment", + "misc_fee_adjustment", + "credit_expiration" + ], + "example": "invoice", + "type": "string" + }, + "updated_at": { + "description": "Invoice line item updated date/time", + "example": "2000-01-01T01:00:00Z", + "format": "date-time", + "type": "string" + } + }, + "type": "object", + "x-docs": null } Value: - "2000-01-01T01:00:00Z" + null diff --git a/openapi3/testdata/apis_guru_openapi_directory/fire_com_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/fire_com_1_0_openapi_yaml__validate index ca8847c9b..7ad621b6c 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/fire_com_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/fire_com_1_0_openapi_yaml__validate @@ -1,11 +1,9 @@ -invalid paths: invalid path /v1/accounts/{ican}/transactions: invalid operation GET: invalid example: unhandled value of type time.Time +invalid paths: invalid path /v1/accounts/{ican}/transactions: invalid operation GET: invalid oneOf element: invalid example: value must be a string Schema: { - "description": "Date of the transaction", - "example": "2021-04-13T11:06:32.437Z", - "format": "date-time", + "example": 6011329, "type": "string" } Value: - "2021-04-13T11:06:32.437Z" + 6011329 diff --git a/openapi3/testdata/apis_guru_openapi_directory/flat_io_2_13_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/flat_io_2_13_0_openapi_yaml__validate index f72b8ed7c..540d8e223 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/flat_io_2_13_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/flat_io_2_13_0_openapi_yaml__validate @@ -1,27 +1 @@ -invalid components: schema "Assignment": invalid example: Error at "/creationDate": unhandled value of type time.Time -Schema: - { - "description": "The date when the submission was created", - "type": "string" - } - -Value: - "2020-08-12T00:25:00.748Z" - | Error at "/returnDate": unhandled value of type time.Time -Schema: - { - "description": "The date when the teacher returned the work", - "type": "string" - } - -Value: - "2020-08-15T00:25:00.748Z" - | Error at "/submissionDate": unhandled value of type time.Time -Schema: - { - "description": "The date when the student submitted his work", - "type": "string" - } - -Value: - "2020-08-12T00:45:22.748Z" +invalid components: schema "ScoreTrack": invalid example: Error at "/measureUuid": string doesn't match the format "uuid": string doesn't match pattern "^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/giphy_com_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/giphy_com_1_0_openapi_yaml__validate index 7e3f8906e..c75deb45f 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/giphy_com_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/giphy_com_1_0_openapi_yaml__validate @@ -1,11 +1 @@ -invalid components: schema "Gif": invalid example: unhandled value of type time.Time -Schema: - { - "description": "The date this GIF was added to the GIPHY database.", - "example": "2013-08-01T12:41:48Z", - "format": "date-time", - "type": "string" - } - -Value: - "2013-08-01T12:41:48Z" +invalid components: schema "Gif": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_api_github_com_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_api_github_com_1_1_4_openapi_yaml__validate index b5cdccf09..3dcff6d14 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_api_github_com_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_api_github_com_1_1_4_openapi_yaml__validate @@ -1,10 +1,8 @@ -invalid components: schema "actions-cache-list": invalid example: unhandled value of type time.Time +invalid components: schema "contributor-activity": invalid example: Error at "/0/w": value must be an integer Schema: { - "example": "2019-01-24T22:45:36Z", - "format": "date-time", - "type": "string" + "type": "integer" } Value: - "2019-01-24T22:45:36Z" + "1367712000" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_api_github_com_2022_11_28_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_api_github_com_2022_11_28_1_1_4_openapi_yaml__validate index b5cdccf09..3dcff6d14 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_api_github_com_2022_11_28_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_api_github_com_2022_11_28_1_1_4_openapi_yaml__validate @@ -1,10 +1,8 @@ -invalid components: schema "actions-cache-list": invalid example: unhandled value of type time.Time +invalid components: schema "contributor-activity": invalid example: Error at "/0/w": value must be an integer Schema: { - "example": "2019-01-24T22:45:36Z", - "format": "date-time", - "type": "string" + "type": "integer" } Value: - "2019-01-24T22:45:36Z" + "1367712000" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghec_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghec_1_1_4_openapi_yaml__validate index b5cdccf09..ac78d6dd1 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghec_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghec_1_1_4_openapi_yaml__validate @@ -1,10 +1 @@ -invalid components: schema "actions-cache-list": invalid example: unhandled value of type time.Time -Schema: - { - "example": "2019-01-24T22:45:36Z", - "format": "date-time", - "type": "string" - } - -Value: - "2019-01-24T22:45:36Z" +invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghec_2022_11_28_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghec_2022_11_28_1_1_4_openapi_yaml__validate index b5cdccf09..ac78d6dd1 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghec_2022_11_28_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghec_2022_11_28_1_1_4_openapi_yaml__validate @@ -1,10 +1 @@ -invalid components: schema "actions-cache-list": invalid example: unhandled value of type time.Time -Schema: - { - "example": "2019-01-24T22:45:36Z", - "format": "date-time", - "type": "string" - } - -Value: - "2019-01-24T22:45:36Z" +invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_18_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_18_1_1_4_openapi_yaml__validate index 0a33c55eb..3dcff6d14 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_18_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_18_1_1_4_openapi_yaml__validate @@ -1,10 +1,8 @@ -invalid components: schema "added-to-project-issue-event": invalid example: unhandled value of type time.Time +invalid components: schema "contributor-activity": invalid example: Error at "/0/w": value must be an integer Schema: { - "example": "2017-07-08T16:18:44-04:00", - "format": "date-time", - "type": "string" + "type": "integer" } Value: - "2017-07-08T16:18:44-04:00" + "1367712000" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_19_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_19_1_1_4_openapi_yaml__validate index 0a33c55eb..3dcff6d14 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_19_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_19_1_1_4_openapi_yaml__validate @@ -1,10 +1,8 @@ -invalid components: schema "added-to-project-issue-event": invalid example: unhandled value of type time.Time +invalid components: schema "contributor-activity": invalid example: Error at "/0/w": value must be an integer Schema: { - "example": "2017-07-08T16:18:44-04:00", - "format": "date-time", - "type": "string" + "type": "integer" } Value: - "2017-07-08T16:18:44-04:00" + "1367712000" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_20_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_20_1_1_4_openapi_yaml__validate index 0a33c55eb..3dcff6d14 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_20_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_20_1_1_4_openapi_yaml__validate @@ -1,10 +1,8 @@ -invalid components: schema "added-to-project-issue-event": invalid example: unhandled value of type time.Time +invalid components: schema "contributor-activity": invalid example: Error at "/0/w": value must be an integer Schema: { - "example": "2017-07-08T16:18:44-04:00", - "format": "date-time", - "type": "string" + "type": "integer" } Value: - "2017-07-08T16:18:44-04:00" + "1367712000" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_21_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_21_1_1_4_openapi_yaml__validate index 0a33c55eb..3dcff6d14 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_21_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_21_1_1_4_openapi_yaml__validate @@ -1,10 +1,8 @@ -invalid components: schema "added-to-project-issue-event": invalid example: unhandled value of type time.Time +invalid components: schema "contributor-activity": invalid example: Error at "/0/w": value must be an integer Schema: { - "example": "2017-07-08T16:18:44-04:00", - "format": "date-time", - "type": "string" + "type": "integer" } Value: - "2017-07-08T16:18:44-04:00" + "1367712000" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_22_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_22_1_1_4_openapi_yaml__validate index fb3fa1a5d..3dcff6d14 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_22_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_2_22_1_1_4_openapi_yaml__validate @@ -1,9 +1,8 @@ -invalid components: schema "actions-public-key": invalid example: unhandled value of type time.Time +invalid components: schema "contributor-activity": invalid example: Error at "/0/w": value must be an integer Schema: { - "example": "2011-01-26T19:01:12Z", - "type": "string" + "type": "integer" } Value: - "2011-01-26T19:01:12Z" + "1367712000" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_0_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_0_1_1_4_openapi_yaml__validate index fb3fa1a5d..ac78d6dd1 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_0_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_0_1_1_4_openapi_yaml__validate @@ -1,9 +1 @@ -invalid components: schema "actions-public-key": invalid example: unhandled value of type time.Time -Schema: - { - "example": "2011-01-26T19:01:12Z", - "type": "string" - } - -Value: - "2011-01-26T19:01:12Z" +invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_1_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_1_1_1_4_openapi_yaml__validate index fb3fa1a5d..ac78d6dd1 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_1_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_1_1_1_4_openapi_yaml__validate @@ -1,9 +1 @@ -invalid components: schema "actions-public-key": invalid example: unhandled value of type time.Time -Schema: - { - "example": "2011-01-26T19:01:12Z", - "type": "string" - } - -Value: - "2011-01-26T19:01:12Z" +invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_2_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_2_1_1_4_openapi_yaml__validate index fb3fa1a5d..ac78d6dd1 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_2_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_2_1_1_4_openapi_yaml__validate @@ -1,9 +1 @@ -invalid components: schema "actions-public-key": invalid example: unhandled value of type time.Time -Schema: - { - "example": "2011-01-26T19:01:12Z", - "type": "string" - } - -Value: - "2011-01-26T19:01:12Z" +invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_3_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_3_1_1_4_openapi_yaml__validate index fb3fa1a5d..ac78d6dd1 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_3_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_3_1_1_4_openapi_yaml__validate @@ -1,9 +1 @@ -invalid components: schema "actions-public-key": invalid example: unhandled value of type time.Time -Schema: - { - "example": "2011-01-26T19:01:12Z", - "type": "string" - } - -Value: - "2011-01-26T19:01:12Z" +invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_4_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_4_1_1_4_openapi_yaml__validate index fb3fa1a5d..ac78d6dd1 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_4_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_4_1_1_4_openapi_yaml__validate @@ -1,9 +1 @@ -invalid components: schema "actions-public-key": invalid example: unhandled value of type time.Time -Schema: - { - "example": "2011-01-26T19:01:12Z", - "type": "string" - } - -Value: - "2011-01-26T19:01:12Z" +invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_5_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_5_1_1_4_openapi_yaml__validate index fb3fa1a5d..ac78d6dd1 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_5_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_5_1_1_4_openapi_yaml__validate @@ -1,9 +1 @@ -invalid components: schema "actions-public-key": invalid example: unhandled value of type time.Time -Schema: - { - "example": "2011-01-26T19:01:12Z", - "type": "string" - } - -Value: - "2011-01-26T19:01:12Z" +invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_6_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_6_1_1_4_openapi_yaml__validate index fb3fa1a5d..ac78d6dd1 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_6_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_6_1_1_4_openapi_yaml__validate @@ -1,9 +1 @@ -invalid components: schema "actions-public-key": invalid example: unhandled value of type time.Time -Schema: - { - "example": "2011-01-26T19:01:12Z", - "type": "string" - } - -Value: - "2011-01-26T19:01:12Z" +invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_7_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_7_1_1_4_openapi_yaml__validate index b5cdccf09..ac78d6dd1 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_7_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_7_1_1_4_openapi_yaml__validate @@ -1,10 +1 @@ -invalid components: schema "actions-cache-list": invalid example: unhandled value of type time.Time -Schema: - { - "example": "2019-01-24T22:45:36Z", - "format": "date-time", - "type": "string" - } - -Value: - "2019-01-24T22:45:36Z" +invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_8_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_8_1_1_4_openapi_yaml__validate index b5cdccf09..ac78d6dd1 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_8_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_ghes_3_8_1_1_4_openapi_yaml__validate @@ -1,10 +1 @@ -invalid components: schema "actions-cache-list": invalid example: unhandled value of type time.Time -Schema: - { - "example": "2019-01-24T22:45:36Z", - "format": "date-time", - "type": "string" - } - -Value: - "2019-01-24T22:45:36Z" +invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/github_com_github_ae_1_1_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/github_com_github_ae_1_1_4_openapi_yaml__validate index fb3fa1a5d..ac78d6dd1 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/github_com_github_ae_1_1_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/github_com_github_ae_1_1_4_openapi_yaml__validate @@ -1,9 +1 @@ -invalid components: schema "actions-public-key": invalid example: unhandled value of type time.Time -Schema: - { - "example": "2011-01-26T19:01:12Z", - "type": "string" - } - -Value: - "2011-01-26T19:01:12Z" +invalid components: schema "announcement": invalid example: string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_bcgnws_3_x_x_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_bcgnws_3_x_x_openapi_yaml__validate index 3300cf5d0..d7feb2a18 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_bcgnws_3_x_x_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_bcgnws_3_x_x_openapi_yaml__validate @@ -1,8 +1,8 @@ -invalid paths: invalid path /names/changes: invalid operation GET: invalid example: unhandled value of type time.Time +invalid paths: invalid path /names/changes: invalid operation GET: invalid example: value must be an integer Schema: { "type": "integer" } Value: - "2017-01-01T00:00:00Z" + "2017-01-01" diff --git a/openapi3/testdata/apis_guru_openapi_directory/hetzner_cloud_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/hetzner_cloud_1_0_0_openapi_yaml__validate index 357a05276..71c581016 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/hetzner_cloud_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/hetzner_cloud_1_0_0_openapi_yaml__validate @@ -1,11 +1,15 @@ -invalid paths: invalid path /actions: invalid operation GET: invalid example: unhandled value of type time.Time +invalid paths: invalid path /certificates: invalid operation GET: invalid example: value is not one of the allowed values ["pending","completed","failed"] Schema: { - "description": "Point in time when the Action was finished (in ISO-8601 format). Only set if the Action is finished otherwise null.", - "example": "2016-01-30T23:55:00Z", - "nullable": true, + "description": "Status of the issuance process of the Certificate", + "enum": [ + "pending", + "completed", + "failed" + ], + "example": "valid", "type": "string" } Value: - "2016-01-30T23:55:00Z" + "valid" diff --git a/openapi3/testdata/apis_guru_openapi_directory/ideal_postcodes_co_uk_3_7_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/ideal_postcodes_co_uk_3_7_0_openapi_yaml__validate index 65fca1cb3..627ac2d40 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/ideal_postcodes_co_uk_3_7_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/ideal_postcodes_co_uk_3_7_0_openapi_yaml__validate @@ -1,11 +1,11 @@ -invalid components: schema "ApiKeyCurrentPurchase": invalid example: unhandled value of type time.Time +invalid components: schema "EcadAddress": invalid allOf element: invalid example: value must be a string Schema: { - "description": "`string` or `null` The date when this purchase will expire in simplified \nextended ISO format (ISO 8601). This is typically 365 days from the time \nof first use. This field will be `null` if the purchase has not yet been \nused.", - "example": "2022-01-06T11:41:27.092Z", - "nullable": true, + "description": "A number associated with the whole building. The building number may have a numeric and an alphanumeric component, which are concatenated e.g. 2A, or alternatively will have a simple building number or a complex building number. The building number always relates to the whole building and not a sub-unit within it.\nA complex building number may be one of the following:\n - Dual. Two number separated by '/' e.g. 63/64 = 63, 64\n - Sequence. An odd or even sequence of numbers with lower and upper bound separated by an underscore '_' e.g. `1_5` = 1,3,5 and `2_6` = 2,4,6 \n - Range. A range of consecutive numbers with lower and upper bound separated by a dash '-' e.g. `63-66` = 63, 64, 56, 66\nThe building number never appears on a line by itself and can prepend Building Group, Primary Thoroughfare or Primary Locality.", + "example": 22, + "maxLength": 40, "type": "string" } Value: - "2022-01-06T11:41:27.092Z" + 22 diff --git a/openapi3/testdata/apis_guru_openapi_directory/increase_com_0_0_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/increase_com_0_0_1_openapi_yaml__validate index 043027b0d..8ac5d0f2a 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/increase_com_0_0_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/increase_com_0_0_1_openapi_yaml__validate @@ -1,21 +1,4110 @@ -invalid components: schema "account": invalid example: Error at "/created_at": unhandled value of type time.Time +invalid components: schema "declined_transaction": invalid example: Error at "/card_decline": property "card_decline" is missing Schema: { - "description": "The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Account was created.", - "format": "date-time", - "type": "string" + "description": "This is an object giving more details on the network-level event that caused the Declined Transaction. For example, for a card transaction this lists the merchant's industry and location. Note that for backwards compatibility reasons, additional undocumented keys may appear in this object. These should be treated as deprecated and will be removed in the future.", + "example": { + "ach_decline": { + "amount": 1750, + "originator_company_descriptive_date": null, + "originator_company_discretionary_data": null, + "originator_company_id": "0987654321", + "originator_company_name": "BIG BANK", + "reason": "insufficient_funds", + "receiver_id_number": "12345678900", + "receiver_name": "IAN CREASE", + "trace_number": "021000038461022" + }, + "category": "ach_decline" + }, + "properties": { + "ach_decline": { + "description": "A ACH Decline object. This field will be present in the JSON response if and only if `category` is equal to `ach_decline`.", + "example": { + "amount": 1750, + "originator_company_descriptive_date": null, + "originator_company_discretionary_data": null, + "originator_company_id": "0987654321", + "originator_company_name": "BIG BANK", + "reason": "insufficient_funds", + "receiver_id_number": "12345678900", + "receiver_name": "IAN CREASE", + "trace_number": "021000038461022" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "originator_company_descriptive_date": { + "nullable": true, + "type": "string" + }, + "originator_company_discretionary_data": { + "nullable": true, + "type": "string" + }, + "originator_company_id": { + "type": "string" + }, + "originator_company_name": { + "type": "string" + }, + "reason": { + "description": "Why the ACH transfer was declined.", + "enum": [ + "ach_route_canceled", + "ach_route_disabled", + "breaches_limit", + "credit_entry_refused_by_receiver", + "duplicate_return", + "entity_not_active", + "group_locked", + "insufficient_funds", + "misrouted_return", + "no_ach_route", + "originator_request", + "transaction_not_allowed" + ], + "type": "string", + "x-enum-descriptions": [ + "The account number is canceled.", + "The account number is disabled.", + "The transaction would cause a limit to be exceeded.", + "A credit was refused.", + "Other.", + "The account's entity is not active.", + "Your account is inactive.", + "Your account contains insufficient funds.", + "Other.", + "The account number that was debited does not exist.", + "Other.", + "The transaction is not allowed per Increase's terms" + ] + }, + "receiver_id_number": { + "nullable": true, + "type": "string" + }, + "receiver_name": { + "nullable": true, + "type": "string" + }, + "trace_number": { + "type": "string" + } + }, + "required": [ + "amount", + "originator_company_name", + "originator_company_descriptive_date", + "originator_company_discretionary_data", + "originator_company_id", + "reason", + "receiver_id_number", + "receiver_name", + "trace_number" + ], + "title": "ACH Decline", + "type": "object", + "x-title-plural": "ACH Declines" + }, + "card_decline": { + "description": "A Card Decline object. This field will be present in the JSON response if and only if `category` is equal to `card_decline`.", + "example": { + "amount": -1000, + "currency": "USD", + "digital_wallet_token_id": null, + "merchant_acceptor_id": "372909060886", + "merchant_category_code": "5998", + "merchant_city": "5364086000", + "merchant_country": "USA", + "merchant_descriptor": "TENTS R US", + "merchant_state": "CA", + "network": "visa", + "network_details": { + "visa": { + "electronic_commerce_indicator": "secure_electronic_commerce", + "point_of_service_entry_mode": "manual" + } + }, + "real_time_decision_id": null, + "reason": "insufficient_funds" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "currency": { + "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination account currency.", + "enum": [ + "CAD", + "CHF", + "EUR", + "GBP", + "JPY", + "USD" + ], + "type": "string", + "x-enum-descriptions": [ + "Canadian Dollar (CAD)", + "Swiss Franc (CHF)", + "Euro (EUR)", + "British Pound (GBP)", + "Japanese Yen (JPY)", + "US Dollar (USD)" + ] + }, + "digital_wallet_token_id": { + "description": "If the authorization was attempted using a Digital Wallet Token (such as an Apple Pay purchase), the identifier of the token that was used.", + "nullable": true, + "type": "string" + }, + "merchant_acceptor_id": { + "description": "The merchant identifier (commonly abbreviated as MID) of the merchant the card is transacting with.", + "type": "string" + }, + "merchant_category_code": { + "description": "The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card is transacting with.", + "nullable": true, + "type": "string" + }, + "merchant_city": { + "description": "The city the merchant resides in.", + "nullable": true, + "type": "string" + }, + "merchant_country": { + "description": "The country the merchant resides in.", + "nullable": true, + "type": "string" + }, + "merchant_descriptor": { + "description": "The merchant descriptor of the merchant the card is transacting with.", + "type": "string" + }, + "merchant_state": { + "description": "The state the merchant resides in.", + "nullable": true, + "type": "string" + }, + "network": { + "description": "The payment network used to process this card authorization", + "enum": [ + "visa" + ], + "type": "string", + "x-enum-descriptions": [ + "Visa" + ] + }, + "network_details": { + "description": "Fields specific to the `network`", + "properties": { + "visa": { + "description": "Fields specific to the `visa` network", + "properties": { + "electronic_commerce_indicator": { + "description": "For electronic commerce transactions, this identifies the level of security used in obtaining the customer's payment credential. For mail or telephone order transactions, identifies the type of mail or telephone order.", + "enum": [ + "mail_phone_order", + "recurring", + "installment", + "unknown_mail_phone_order", + "secure_electronic_commerce", + "non_authenticated_security_transaction_at_3ds_capable_merchant", + "non_authenticated_security_transaction", + "non_secure_transaction" + ], + "nullable": true, + "type": "string", + "x-enum-descriptions": [ + "Single transaction of a mail/phone order: Use to indicate that the transaction is a mail/phone order purchase, not a recurring transaction or installment payment. For domestic transactions in the US region, this value may also indicate one bill payment transaction in the card-present or card-absent environments.", + "Recurring transaction: Payment indicator used to indicate a recurring transaction that originates from an acquirer in the US region.", + "Installment payment: Payment indicator used to indicate one purchase of goods or services that is billed to the account in multiple charges over a period of time agreed upon by the cardholder and merchant from transactions that originate from an acquirer in the US region.", + "Unknown classification: other mail order: Use to indicate that the type of mail/telephone order is unknown.", + "Secure electronic commerce transaction: Use to indicate that the electronic commerce transaction has been authenticated using e.g., 3-D Secure", + "Non-authenticated security transaction at a 3-D Secure-capable merchant, and merchant attempted to authenticate the cardholder using 3-D Secure: Use to identify an electronic commerce transaction where the merchant attempted to authenticate the cardholder using 3-D Secure, but was unable to complete the authentication because the issuer or cardholder does not participate in the 3-D Secure program.", + "Non-authenticated security transaction: Use to identify an electronic commerce transaction that uses data encryption for security however , cardholder authentication is not performed using 3-D Secure.", + "Non-secure transaction: Use to identify an electronic commerce transaction that has no data protection." + ] + }, + "point_of_service_entry_mode": { + "description": "The method used to enter the cardholder's primary account number and card expiration date", + "enum": [ + "manual", + "magnetic_stripe_no_cvv", + "optical_code", + "integrated_circuit_card", + "contactless", + "credential_on_file", + "magnetic_stripe", + "contactless_magnetic_stripe", + "integrated_circuit_card_no_cvv" + ], + "nullable": true, + "type": "string", + "x-enum-descriptions": [ + "Manual key entry", + "Magnetic stripe read, without card verification value", + "Optical code", + "Contact chip card", + "Contactless read of chip card", + "Transaction iniated using a credential that has previously been stored on file", + "Magnetic stripe read", + "Contactless read of magnetic stripe data", + "Contact chip card, without card verification value" + ] + } + }, + "required": [ + "electronic_commerce_indicator", + "point_of_service_entry_mode" + ], + "title": "Visa", + "type": "object", + "x-title-plural": "Visas" + } + }, + "required": [ + "visa" + ], + "title": "Network Details", + "type": "object", + "x-title-plural": "Network Detailss" + }, + "real_time_decision_id": { + "description": "The identifier of the Real-Time Decision sent to approve or decline this transaction.", + "nullable": true, + "type": "string" + }, + "reason": { + "description": "Why the transaction was declined.", + "enum": [ + "card_not_active", + "entity_not_active", + "group_locked", + "insufficient_funds", + "cvv2_mismatch", + "transaction_not_allowed", + "breaches_limit", + "webhook_declined", + "webhook_timed_out", + "declined_by_stand_in_processing", + "invalid_physical_card", + "missing_original_authorization" + ], + "type": "string", + "x-enum-descriptions": [ + "The Card was not active.", + "The account's entity was not active.", + "The account was inactive.", + "The Card's Account did not have a sufficient available balance.", + "The given CVV2 did not match the card's value.", + "The attempted card transaction is not allowed per Increase's terms.", + "The transaction was blocked by a Limit.", + "Your application declined the transaction via webhook.", + "Your application webhook did not respond without the required timeout.", + "Declined by stand-in processing.", + "The card read had an invalid CVV, dCVV, or authorization request cryptogram.", + "The original card authorization for this incremental authorization does not exist." + ] + } + }, + "required": [ + "merchant_acceptor_id", + "merchant_descriptor", + "merchant_category_code", + "merchant_city", + "merchant_country", + "network", + "network_details", + "amount", + "currency", + "reason", + "merchant_state", + "real_time_decision_id", + "digital_wallet_token_id" + ], + "title": "Card Decline", + "type": "object", + "x-title-plural": "Card Declines" + }, + "card_route_decline": { + "description": "A Deprecated Card Decline object. This field will be present in the JSON response if and only if `category` is equal to `card_route_decline`.", + "example": { + "amount": -1000, + "currency": "USD", + "merchant_acceptor_id": "372909060886", + "merchant_category_code": "5998", + "merchant_city": "5364086000", + "merchant_country": "USA", + "merchant_descriptor": "TENTS R US", + "merchant_state": "CA" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "currency": { + "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination account currency.", + "enum": [ + "CAD", + "CHF", + "EUR", + "GBP", + "JPY", + "USD" + ], + "type": "string", + "x-enum-descriptions": [ + "Canadian Dollar (CAD)", + "Swiss Franc (CHF)", + "Euro (EUR)", + "British Pound (GBP)", + "Japanese Yen (JPY)", + "US Dollar (USD)" + ] + }, + "merchant_acceptor_id": { + "type": "string" + }, + "merchant_category_code": { + "nullable": true, + "type": "string" + }, + "merchant_city": { + "nullable": true, + "type": "string" + }, + "merchant_country": { + "type": "string" + }, + "merchant_descriptor": { + "type": "string" + }, + "merchant_state": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "amount", + "currency", + "merchant_acceptor_id", + "merchant_city", + "merchant_country", + "merchant_descriptor", + "merchant_state", + "merchant_category_code" + ], + "title": "Deprecated Card Decline", + "type": "object", + "x-title-plural": "Deprecated Card Declines" + }, + "category": { + "description": "The type of decline that took place. We may add additional possible values for this enum over time; your application should be able to handle such additions gracefully.", + "enum": [ + "ach_decline", + "card_decline", + "check_decline", + "inbound_real_time_payments_transfer_decline", + "international_ach_decline", + "card_route_decline", + "other" + ], + "type": "string", + "x-enum-descriptions": [ + "The Declined Transaction was created by a ACH Decline object. Details will be under the `ach_decline` object.", + "The Declined Transaction was created by a Card Decline object. Details will be under the `card_decline` object.", + "The Declined Transaction was created by a Check Decline object. Details will be under the `check_decline` object.", + "The Declined Transaction was created by a Inbound Real Time Payments Transfer Decline object. Details will be under the `inbound_real_time_payments_transfer_decline` object.", + "The Declined Transaction was created by a International ACH Decline object. Details will be under the `international_ach_decline` object.", + "The Declined Transaction was created by a Deprecated Card Decline object. Details will be under the `card_route_decline` object.", + "The Declined Transaction was made for an undocumented or deprecated reason." + ] + }, + "check_decline": { + "description": "A Check Decline object. This field will be present in the JSON response if and only if `category` is equal to `check_decline`.", + "example": { + "amount": -1000, + "auxiliary_on_us": "99999", + "reason": "insufficient_funds" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "auxiliary_on_us": { + "nullable": true, + "type": "string" + }, + "reason": { + "description": "Why the check was declined.", + "enum": [ + "ach_route_canceled", + "ach_route_disabled", + "breaches_limit", + "entity_not_active", + "group_locked", + "insufficient_funds", + "unable_to_locate_account", + "unable_to_process", + "refer_to_image", + "stop_payment_requested", + "returned", + "duplicate_presentment", + "not_authorized" + ], + "type": "string", + "x-enum-descriptions": [ + "The account number is canceled.", + "The account number is disabled.", + "The transaction would cause a limit to be exceeded.", + "The account's entity is not active.", + "Your account is inactive.", + "Your account contains insufficient funds.", + "Unable to locate account.", + "Unable to process.", + "Refer to image.", + "Stop payment requested for this check.", + "Check was returned to sender.", + "The check was a duplicate deposit.", + "The transaction is not allowed." + ] + } + }, + "required": [ + "amount", + "auxiliary_on_us", + "reason" + ], + "title": "Check Decline", + "type": "object", + "x-title-plural": "Check Declines" + }, + "inbound_real_time_payments_transfer_decline": { + "description": "A Inbound Real Time Payments Transfer Decline object. This field will be present in the JSON response if and only if `category` is equal to `inbound_real_time_payments_transfer_decline`.", + "example": { + "amount": 100, + "creditor_name": "Ian Crease", + "currency": "USD", + "debtor_account_number": "987654321", + "debtor_name": "National Phonograph Company", + "debtor_routing_number": "101050001", + "reason": "account_number_disabled", + "remittance_information": "Invoice 29582", + "transaction_identification": "20220501234567891T1BSLZO01745013025" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "creditor_name": { + "description": "The name the sender of the transfer specified as the recipient of the transfer.", + "type": "string" + }, + "currency": { + "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the declined transfer's currency. This will always be \"USD\" for a Real Time Payments transfer.", + "enum": [ + "CAD", + "CHF", + "EUR", + "GBP", + "JPY", + "USD" + ], + "type": "string", + "x-enum-descriptions": [ + "Canadian Dollar (CAD)", + "Swiss Franc (CHF)", + "Euro (EUR)", + "British Pound (GBP)", + "Japanese Yen (JPY)", + "US Dollar (USD)" + ] + }, + "debtor_account_number": { + "description": "The account number of the account that sent the transfer.", + "type": "string" + }, + "debtor_name": { + "description": "The name provided by the sender of the transfer.", + "type": "string" + }, + "debtor_routing_number": { + "description": "The routing number of the account that sent the transfer.", + "type": "string" + }, + "reason": { + "description": "Why the transfer was declined.", + "enum": [ + "account_number_canceled", + "account_number_disabled", + "group_locked", + "entity_not_active", + "real_time_payments_not_enabled" + ], + "type": "string", + "x-enum-descriptions": [ + "The account number is canceled.", + "The account number is disabled.", + "Your account is inactive.", + "The account's entity is not active.", + "Your account is not enabled to receive Real Time Payments transfers." + ] + }, + "remittance_information": { + "description": "Additional information included with the transfer.", + "nullable": true, + "type": "string" + }, + "transaction_identification": { + "description": "The Real Time Payments network identification of the declined transfer.", + "type": "string" + } + }, + "required": [ + "amount", + "currency", + "reason", + "creditor_name", + "debtor_name", + "debtor_account_number", + "debtor_routing_number", + "transaction_identification", + "remittance_information" + ], + "title": "Inbound Real Time Payments Transfer Decline", + "type": "object", + "x-title-plural": "Inbound Real Time Payments Transfer Declines" + }, + "international_ach_decline": { + "description": "A International ACH Decline object. This field will be present in the JSON response if and only if `category` is equal to `international_ach_decline`.", + "example": { + "amount": -1000, + "destination_country_code": "US", + "destination_currency_code": "USD", + "foreign_exchange_indicator": "fixed_to_fixed", + "foreign_exchange_reference": null, + "foreign_exchange_reference_indicator": "blank", + "foreign_payment_amount": 199, + "foreign_trace_number": null, + "international_transaction_type_code": "internet_initiated", + "originating_currency_code": "USD", + "originating_depository_financial_institution_branch_country": "US", + "originating_depository_financial_institution_id": "091000019", + "originating_depository_financial_institution_id_qualifier": "national_clearing_system_number", + "originating_depository_financial_institution_name": "WELLS FARGO BANK", + "originator_city": "BERLIN", + "originator_company_entry_description": "RETRY PYMT", + "originator_country": "DE", + "originator_identification": "770510487A", + "originator_name": "BERGHAIN", + "originator_postal_code": "50825", + "originator_state_or_province": null, + "originator_street_address": "Ruedersdorferstr. 7", + "payment_related_information": null, + "payment_related_information2": null, + "receiver_city": "BEVERLY HILLS", + "receiver_country": "US", + "receiver_identification_number": "1018790279274", + "receiver_postal_code": "90210", + "receiver_state_or_province": "CA", + "receiver_street_address": "123 FAKE ST", + "receiving_company_or_individual_name": "IAN CREASE", + "receiving_depository_financial_institution_country": "US", + "receiving_depository_financial_institution_id": "101050001", + "receiving_depository_financial_institution_id_qualifier": "national_clearing_system_number", + "receiving_depository_financial_institution_name": "BLUE RIDGE BANK, NATIONAL ASSOCIATI", + "trace_number": "010202909100090" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "destination_country_code": { + "type": "string" + }, + "destination_currency_code": { + "type": "string" + }, + "foreign_exchange_indicator": { + "type": "string" + }, + "foreign_exchange_reference": { + "nullable": true, + "type": "string" + }, + "foreign_exchange_reference_indicator": { + "type": "string" + }, + "foreign_payment_amount": { + "type": "integer" + }, + "foreign_trace_number": { + "nullable": true, + "type": "string" + }, + "international_transaction_type_code": { + "type": "string" + }, + "originating_currency_code": { + "type": "string" + }, + "originating_depository_financial_institution_branch_country": { + "type": "string" + }, + "originating_depository_financial_institution_id": { + "type": "string" + }, + "originating_depository_financial_institution_id_qualifier": { + "type": "string" + }, + "originating_depository_financial_institution_name": { + "type": "string" + }, + "originator_city": { + "type": "string" + }, + "originator_company_entry_description": { + "type": "string" + }, + "originator_country": { + "type": "string" + }, + "originator_identification": { + "type": "string" + }, + "originator_name": { + "type": "string" + }, + "originator_postal_code": { + "nullable": true, + "type": "string" + }, + "originator_state_or_province": { + "nullable": true, + "type": "string" + }, + "originator_street_address": { + "type": "string" + }, + "payment_related_information": { + "nullable": true, + "type": "string" + }, + "payment_related_information2": { + "nullable": true, + "type": "string" + }, + "receiver_city": { + "type": "string" + }, + "receiver_country": { + "type": "string" + }, + "receiver_identification_number": { + "nullable": true, + "type": "string" + }, + "receiver_postal_code": { + "nullable": true, + "type": "string" + }, + "receiver_state_or_province": { + "nullable": true, + "type": "string" + }, + "receiver_street_address": { + "type": "string" + }, + "receiving_company_or_individual_name": { + "type": "string" + }, + "receiving_depository_financial_institution_country": { + "type": "string" + }, + "receiving_depository_financial_institution_id": { + "type": "string" + }, + "receiving_depository_financial_institution_id_qualifier": { + "type": "string" + }, + "receiving_depository_financial_institution_name": { + "type": "string" + }, + "trace_number": { + "type": "string" + } + }, + "required": [ + "amount", + "foreign_exchange_indicator", + "foreign_exchange_reference_indicator", + "foreign_exchange_reference", + "destination_country_code", + "destination_currency_code", + "foreign_payment_amount", + "foreign_trace_number", + "international_transaction_type_code", + "originating_currency_code", + "originating_depository_financial_institution_name", + "originating_depository_financial_institution_id_qualifier", + "originating_depository_financial_institution_id", + "originating_depository_financial_institution_branch_country", + "originator_city", + "originator_company_entry_description", + "originator_country", + "originator_identification", + "originator_name", + "originator_postal_code", + "originator_street_address", + "originator_state_or_province", + "payment_related_information", + "payment_related_information2", + "receiver_identification_number", + "receiver_street_address", + "receiver_city", + "receiver_state_or_province", + "receiver_country", + "receiver_postal_code", + "receiving_company_or_individual_name", + "receiving_depository_financial_institution_name", + "receiving_depository_financial_institution_id_qualifier", + "receiving_depository_financial_institution_id", + "receiving_depository_financial_institution_country", + "trace_number" + ], + "title": "International ACH Decline", + "type": "object", + "x-title-plural": "International ACH Declines" + } + }, + "required": [ + "category", + "ach_decline", + "card_decline", + "check_decline", + "inbound_real_time_payments_transfer_decline", + "international_ach_decline", + "card_route_decline" + ], + "title": "Declined Transaction Source", + "type": "object", + "x-title-plural": "Declined Transaction Sources" } Value: - "2020-01-31T23:59:59Z" - | Error at "/interest_accrued_at": unhandled value of type time.Time + { + "ach_decline": { + "amount": 1750, + "originator_company_descriptive_date": null, + "originator_company_discretionary_data": null, + "originator_company_id": "0987654321", + "originator_company_name": "BIG BANK", + "reason": "insufficient_funds", + "receiver_id_number": "12345678900", + "receiver_name": "IAN CREASE", + "trace_number": "021000038461022" + }, + "category": "ach_decline" + } + | Error at "/check_decline": property "check_decline" is missing Schema: { - "description": "The latest [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which interest was accrued.", - "format": "date", - "nullable": true, - "type": "string" + "description": "This is an object giving more details on the network-level event that caused the Declined Transaction. For example, for a card transaction this lists the merchant's industry and location. Note that for backwards compatibility reasons, additional undocumented keys may appear in this object. These should be treated as deprecated and will be removed in the future.", + "example": { + "ach_decline": { + "amount": 1750, + "originator_company_descriptive_date": null, + "originator_company_discretionary_data": null, + "originator_company_id": "0987654321", + "originator_company_name": "BIG BANK", + "reason": "insufficient_funds", + "receiver_id_number": "12345678900", + "receiver_name": "IAN CREASE", + "trace_number": "021000038461022" + }, + "category": "ach_decline" + }, + "properties": { + "ach_decline": { + "description": "A ACH Decline object. This field will be present in the JSON response if and only if `category` is equal to `ach_decline`.", + "example": { + "amount": 1750, + "originator_company_descriptive_date": null, + "originator_company_discretionary_data": null, + "originator_company_id": "0987654321", + "originator_company_name": "BIG BANK", + "reason": "insufficient_funds", + "receiver_id_number": "12345678900", + "receiver_name": "IAN CREASE", + "trace_number": "021000038461022" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "originator_company_descriptive_date": { + "nullable": true, + "type": "string" + }, + "originator_company_discretionary_data": { + "nullable": true, + "type": "string" + }, + "originator_company_id": { + "type": "string" + }, + "originator_company_name": { + "type": "string" + }, + "reason": { + "description": "Why the ACH transfer was declined.", + "enum": [ + "ach_route_canceled", + "ach_route_disabled", + "breaches_limit", + "credit_entry_refused_by_receiver", + "duplicate_return", + "entity_not_active", + "group_locked", + "insufficient_funds", + "misrouted_return", + "no_ach_route", + "originator_request", + "transaction_not_allowed" + ], + "type": "string", + "x-enum-descriptions": [ + "The account number is canceled.", + "The account number is disabled.", + "The transaction would cause a limit to be exceeded.", + "A credit was refused.", + "Other.", + "The account's entity is not active.", + "Your account is inactive.", + "Your account contains insufficient funds.", + "Other.", + "The account number that was debited does not exist.", + "Other.", + "The transaction is not allowed per Increase's terms" + ] + }, + "receiver_id_number": { + "nullable": true, + "type": "string" + }, + "receiver_name": { + "nullable": true, + "type": "string" + }, + "trace_number": { + "type": "string" + } + }, + "required": [ + "amount", + "originator_company_name", + "originator_company_descriptive_date", + "originator_company_discretionary_data", + "originator_company_id", + "reason", + "receiver_id_number", + "receiver_name", + "trace_number" + ], + "title": "ACH Decline", + "type": "object", + "x-title-plural": "ACH Declines" + }, + "card_decline": { + "description": "A Card Decline object. This field will be present in the JSON response if and only if `category` is equal to `card_decline`.", + "example": { + "amount": -1000, + "currency": "USD", + "digital_wallet_token_id": null, + "merchant_acceptor_id": "372909060886", + "merchant_category_code": "5998", + "merchant_city": "5364086000", + "merchant_country": "USA", + "merchant_descriptor": "TENTS R US", + "merchant_state": "CA", + "network": "visa", + "network_details": { + "visa": { + "electronic_commerce_indicator": "secure_electronic_commerce", + "point_of_service_entry_mode": "manual" + } + }, + "real_time_decision_id": null, + "reason": "insufficient_funds" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "currency": { + "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination account currency.", + "enum": [ + "CAD", + "CHF", + "EUR", + "GBP", + "JPY", + "USD" + ], + "type": "string", + "x-enum-descriptions": [ + "Canadian Dollar (CAD)", + "Swiss Franc (CHF)", + "Euro (EUR)", + "British Pound (GBP)", + "Japanese Yen (JPY)", + "US Dollar (USD)" + ] + }, + "digital_wallet_token_id": { + "description": "If the authorization was attempted using a Digital Wallet Token (such as an Apple Pay purchase), the identifier of the token that was used.", + "nullable": true, + "type": "string" + }, + "merchant_acceptor_id": { + "description": "The merchant identifier (commonly abbreviated as MID) of the merchant the card is transacting with.", + "type": "string" + }, + "merchant_category_code": { + "description": "The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card is transacting with.", + "nullable": true, + "type": "string" + }, + "merchant_city": { + "description": "The city the merchant resides in.", + "nullable": true, + "type": "string" + }, + "merchant_country": { + "description": "The country the merchant resides in.", + "nullable": true, + "type": "string" + }, + "merchant_descriptor": { + "description": "The merchant descriptor of the merchant the card is transacting with.", + "type": "string" + }, + "merchant_state": { + "description": "The state the merchant resides in.", + "nullable": true, + "type": "string" + }, + "network": { + "description": "The payment network used to process this card authorization", + "enum": [ + "visa" + ], + "type": "string", + "x-enum-descriptions": [ + "Visa" + ] + }, + "network_details": { + "description": "Fields specific to the `network`", + "properties": { + "visa": { + "description": "Fields specific to the `visa` network", + "properties": { + "electronic_commerce_indicator": { + "description": "For electronic commerce transactions, this identifies the level of security used in obtaining the customer's payment credential. For mail or telephone order transactions, identifies the type of mail or telephone order.", + "enum": [ + "mail_phone_order", + "recurring", + "installment", + "unknown_mail_phone_order", + "secure_electronic_commerce", + "non_authenticated_security_transaction_at_3ds_capable_merchant", + "non_authenticated_security_transaction", + "non_secure_transaction" + ], + "nullable": true, + "type": "string", + "x-enum-descriptions": [ + "Single transaction of a mail/phone order: Use to indicate that the transaction is a mail/phone order purchase, not a recurring transaction or installment payment. For domestic transactions in the US region, this value may also indicate one bill payment transaction in the card-present or card-absent environments.", + "Recurring transaction: Payment indicator used to indicate a recurring transaction that originates from an acquirer in the US region.", + "Installment payment: Payment indicator used to indicate one purchase of goods or services that is billed to the account in multiple charges over a period of time agreed upon by the cardholder and merchant from transactions that originate from an acquirer in the US region.", + "Unknown classification: other mail order: Use to indicate that the type of mail/telephone order is unknown.", + "Secure electronic commerce transaction: Use to indicate that the electronic commerce transaction has been authenticated using e.g., 3-D Secure", + "Non-authenticated security transaction at a 3-D Secure-capable merchant, and merchant attempted to authenticate the cardholder using 3-D Secure: Use to identify an electronic commerce transaction where the merchant attempted to authenticate the cardholder using 3-D Secure, but was unable to complete the authentication because the issuer or cardholder does not participate in the 3-D Secure program.", + "Non-authenticated security transaction: Use to identify an electronic commerce transaction that uses data encryption for security however , cardholder authentication is not performed using 3-D Secure.", + "Non-secure transaction: Use to identify an electronic commerce transaction that has no data protection." + ] + }, + "point_of_service_entry_mode": { + "description": "The method used to enter the cardholder's primary account number and card expiration date", + "enum": [ + "manual", + "magnetic_stripe_no_cvv", + "optical_code", + "integrated_circuit_card", + "contactless", + "credential_on_file", + "magnetic_stripe", + "contactless_magnetic_stripe", + "integrated_circuit_card_no_cvv" + ], + "nullable": true, + "type": "string", + "x-enum-descriptions": [ + "Manual key entry", + "Magnetic stripe read, without card verification value", + "Optical code", + "Contact chip card", + "Contactless read of chip card", + "Transaction iniated using a credential that has previously been stored on file", + "Magnetic stripe read", + "Contactless read of magnetic stripe data", + "Contact chip card, without card verification value" + ] + } + }, + "required": [ + "electronic_commerce_indicator", + "point_of_service_entry_mode" + ], + "title": "Visa", + "type": "object", + "x-title-plural": "Visas" + } + }, + "required": [ + "visa" + ], + "title": "Network Details", + "type": "object", + "x-title-plural": "Network Detailss" + }, + "real_time_decision_id": { + "description": "The identifier of the Real-Time Decision sent to approve or decline this transaction.", + "nullable": true, + "type": "string" + }, + "reason": { + "description": "Why the transaction was declined.", + "enum": [ + "card_not_active", + "entity_not_active", + "group_locked", + "insufficient_funds", + "cvv2_mismatch", + "transaction_not_allowed", + "breaches_limit", + "webhook_declined", + "webhook_timed_out", + "declined_by_stand_in_processing", + "invalid_physical_card", + "missing_original_authorization" + ], + "type": "string", + "x-enum-descriptions": [ + "The Card was not active.", + "The account's entity was not active.", + "The account was inactive.", + "The Card's Account did not have a sufficient available balance.", + "The given CVV2 did not match the card's value.", + "The attempted card transaction is not allowed per Increase's terms.", + "The transaction was blocked by a Limit.", + "Your application declined the transaction via webhook.", + "Your application webhook did not respond without the required timeout.", + "Declined by stand-in processing.", + "The card read had an invalid CVV, dCVV, or authorization request cryptogram.", + "The original card authorization for this incremental authorization does not exist." + ] + } + }, + "required": [ + "merchant_acceptor_id", + "merchant_descriptor", + "merchant_category_code", + "merchant_city", + "merchant_country", + "network", + "network_details", + "amount", + "currency", + "reason", + "merchant_state", + "real_time_decision_id", + "digital_wallet_token_id" + ], + "title": "Card Decline", + "type": "object", + "x-title-plural": "Card Declines" + }, + "card_route_decline": { + "description": "A Deprecated Card Decline object. This field will be present in the JSON response if and only if `category` is equal to `card_route_decline`.", + "example": { + "amount": -1000, + "currency": "USD", + "merchant_acceptor_id": "372909060886", + "merchant_category_code": "5998", + "merchant_city": "5364086000", + "merchant_country": "USA", + "merchant_descriptor": "TENTS R US", + "merchant_state": "CA" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "currency": { + "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination account currency.", + "enum": [ + "CAD", + "CHF", + "EUR", + "GBP", + "JPY", + "USD" + ], + "type": "string", + "x-enum-descriptions": [ + "Canadian Dollar (CAD)", + "Swiss Franc (CHF)", + "Euro (EUR)", + "British Pound (GBP)", + "Japanese Yen (JPY)", + "US Dollar (USD)" + ] + }, + "merchant_acceptor_id": { + "type": "string" + }, + "merchant_category_code": { + "nullable": true, + "type": "string" + }, + "merchant_city": { + "nullable": true, + "type": "string" + }, + "merchant_country": { + "type": "string" + }, + "merchant_descriptor": { + "type": "string" + }, + "merchant_state": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "amount", + "currency", + "merchant_acceptor_id", + "merchant_city", + "merchant_country", + "merchant_descriptor", + "merchant_state", + "merchant_category_code" + ], + "title": "Deprecated Card Decline", + "type": "object", + "x-title-plural": "Deprecated Card Declines" + }, + "category": { + "description": "The type of decline that took place. We may add additional possible values for this enum over time; your application should be able to handle such additions gracefully.", + "enum": [ + "ach_decline", + "card_decline", + "check_decline", + "inbound_real_time_payments_transfer_decline", + "international_ach_decline", + "card_route_decline", + "other" + ], + "type": "string", + "x-enum-descriptions": [ + "The Declined Transaction was created by a ACH Decline object. Details will be under the `ach_decline` object.", + "The Declined Transaction was created by a Card Decline object. Details will be under the `card_decline` object.", + "The Declined Transaction was created by a Check Decline object. Details will be under the `check_decline` object.", + "The Declined Transaction was created by a Inbound Real Time Payments Transfer Decline object. Details will be under the `inbound_real_time_payments_transfer_decline` object.", + "The Declined Transaction was created by a International ACH Decline object. Details will be under the `international_ach_decline` object.", + "The Declined Transaction was created by a Deprecated Card Decline object. Details will be under the `card_route_decline` object.", + "The Declined Transaction was made for an undocumented or deprecated reason." + ] + }, + "check_decline": { + "description": "A Check Decline object. This field will be present in the JSON response if and only if `category` is equal to `check_decline`.", + "example": { + "amount": -1000, + "auxiliary_on_us": "99999", + "reason": "insufficient_funds" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "auxiliary_on_us": { + "nullable": true, + "type": "string" + }, + "reason": { + "description": "Why the check was declined.", + "enum": [ + "ach_route_canceled", + "ach_route_disabled", + "breaches_limit", + "entity_not_active", + "group_locked", + "insufficient_funds", + "unable_to_locate_account", + "unable_to_process", + "refer_to_image", + "stop_payment_requested", + "returned", + "duplicate_presentment", + "not_authorized" + ], + "type": "string", + "x-enum-descriptions": [ + "The account number is canceled.", + "The account number is disabled.", + "The transaction would cause a limit to be exceeded.", + "The account's entity is not active.", + "Your account is inactive.", + "Your account contains insufficient funds.", + "Unable to locate account.", + "Unable to process.", + "Refer to image.", + "Stop payment requested for this check.", + "Check was returned to sender.", + "The check was a duplicate deposit.", + "The transaction is not allowed." + ] + } + }, + "required": [ + "amount", + "auxiliary_on_us", + "reason" + ], + "title": "Check Decline", + "type": "object", + "x-title-plural": "Check Declines" + }, + "inbound_real_time_payments_transfer_decline": { + "description": "A Inbound Real Time Payments Transfer Decline object. This field will be present in the JSON response if and only if `category` is equal to `inbound_real_time_payments_transfer_decline`.", + "example": { + "amount": 100, + "creditor_name": "Ian Crease", + "currency": "USD", + "debtor_account_number": "987654321", + "debtor_name": "National Phonograph Company", + "debtor_routing_number": "101050001", + "reason": "account_number_disabled", + "remittance_information": "Invoice 29582", + "transaction_identification": "20220501234567891T1BSLZO01745013025" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "creditor_name": { + "description": "The name the sender of the transfer specified as the recipient of the transfer.", + "type": "string" + }, + "currency": { + "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the declined transfer's currency. This will always be \"USD\" for a Real Time Payments transfer.", + "enum": [ + "CAD", + "CHF", + "EUR", + "GBP", + "JPY", + "USD" + ], + "type": "string", + "x-enum-descriptions": [ + "Canadian Dollar (CAD)", + "Swiss Franc (CHF)", + "Euro (EUR)", + "British Pound (GBP)", + "Japanese Yen (JPY)", + "US Dollar (USD)" + ] + }, + "debtor_account_number": { + "description": "The account number of the account that sent the transfer.", + "type": "string" + }, + "debtor_name": { + "description": "The name provided by the sender of the transfer.", + "type": "string" + }, + "debtor_routing_number": { + "description": "The routing number of the account that sent the transfer.", + "type": "string" + }, + "reason": { + "description": "Why the transfer was declined.", + "enum": [ + "account_number_canceled", + "account_number_disabled", + "group_locked", + "entity_not_active", + "real_time_payments_not_enabled" + ], + "type": "string", + "x-enum-descriptions": [ + "The account number is canceled.", + "The account number is disabled.", + "Your account is inactive.", + "The account's entity is not active.", + "Your account is not enabled to receive Real Time Payments transfers." + ] + }, + "remittance_information": { + "description": "Additional information included with the transfer.", + "nullable": true, + "type": "string" + }, + "transaction_identification": { + "description": "The Real Time Payments network identification of the declined transfer.", + "type": "string" + } + }, + "required": [ + "amount", + "currency", + "reason", + "creditor_name", + "debtor_name", + "debtor_account_number", + "debtor_routing_number", + "transaction_identification", + "remittance_information" + ], + "title": "Inbound Real Time Payments Transfer Decline", + "type": "object", + "x-title-plural": "Inbound Real Time Payments Transfer Declines" + }, + "international_ach_decline": { + "description": "A International ACH Decline object. This field will be present in the JSON response if and only if `category` is equal to `international_ach_decline`.", + "example": { + "amount": -1000, + "destination_country_code": "US", + "destination_currency_code": "USD", + "foreign_exchange_indicator": "fixed_to_fixed", + "foreign_exchange_reference": null, + "foreign_exchange_reference_indicator": "blank", + "foreign_payment_amount": 199, + "foreign_trace_number": null, + "international_transaction_type_code": "internet_initiated", + "originating_currency_code": "USD", + "originating_depository_financial_institution_branch_country": "US", + "originating_depository_financial_institution_id": "091000019", + "originating_depository_financial_institution_id_qualifier": "national_clearing_system_number", + "originating_depository_financial_institution_name": "WELLS FARGO BANK", + "originator_city": "BERLIN", + "originator_company_entry_description": "RETRY PYMT", + "originator_country": "DE", + "originator_identification": "770510487A", + "originator_name": "BERGHAIN", + "originator_postal_code": "50825", + "originator_state_or_province": null, + "originator_street_address": "Ruedersdorferstr. 7", + "payment_related_information": null, + "payment_related_information2": null, + "receiver_city": "BEVERLY HILLS", + "receiver_country": "US", + "receiver_identification_number": "1018790279274", + "receiver_postal_code": "90210", + "receiver_state_or_province": "CA", + "receiver_street_address": "123 FAKE ST", + "receiving_company_or_individual_name": "IAN CREASE", + "receiving_depository_financial_institution_country": "US", + "receiving_depository_financial_institution_id": "101050001", + "receiving_depository_financial_institution_id_qualifier": "national_clearing_system_number", + "receiving_depository_financial_institution_name": "BLUE RIDGE BANK, NATIONAL ASSOCIATI", + "trace_number": "010202909100090" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "destination_country_code": { + "type": "string" + }, + "destination_currency_code": { + "type": "string" + }, + "foreign_exchange_indicator": { + "type": "string" + }, + "foreign_exchange_reference": { + "nullable": true, + "type": "string" + }, + "foreign_exchange_reference_indicator": { + "type": "string" + }, + "foreign_payment_amount": { + "type": "integer" + }, + "foreign_trace_number": { + "nullable": true, + "type": "string" + }, + "international_transaction_type_code": { + "type": "string" + }, + "originating_currency_code": { + "type": "string" + }, + "originating_depository_financial_institution_branch_country": { + "type": "string" + }, + "originating_depository_financial_institution_id": { + "type": "string" + }, + "originating_depository_financial_institution_id_qualifier": { + "type": "string" + }, + "originating_depository_financial_institution_name": { + "type": "string" + }, + "originator_city": { + "type": "string" + }, + "originator_company_entry_description": { + "type": "string" + }, + "originator_country": { + "type": "string" + }, + "originator_identification": { + "type": "string" + }, + "originator_name": { + "type": "string" + }, + "originator_postal_code": { + "nullable": true, + "type": "string" + }, + "originator_state_or_province": { + "nullable": true, + "type": "string" + }, + "originator_street_address": { + "type": "string" + }, + "payment_related_information": { + "nullable": true, + "type": "string" + }, + "payment_related_information2": { + "nullable": true, + "type": "string" + }, + "receiver_city": { + "type": "string" + }, + "receiver_country": { + "type": "string" + }, + "receiver_identification_number": { + "nullable": true, + "type": "string" + }, + "receiver_postal_code": { + "nullable": true, + "type": "string" + }, + "receiver_state_or_province": { + "nullable": true, + "type": "string" + }, + "receiver_street_address": { + "type": "string" + }, + "receiving_company_or_individual_name": { + "type": "string" + }, + "receiving_depository_financial_institution_country": { + "type": "string" + }, + "receiving_depository_financial_institution_id": { + "type": "string" + }, + "receiving_depository_financial_institution_id_qualifier": { + "type": "string" + }, + "receiving_depository_financial_institution_name": { + "type": "string" + }, + "trace_number": { + "type": "string" + } + }, + "required": [ + "amount", + "foreign_exchange_indicator", + "foreign_exchange_reference_indicator", + "foreign_exchange_reference", + "destination_country_code", + "destination_currency_code", + "foreign_payment_amount", + "foreign_trace_number", + "international_transaction_type_code", + "originating_currency_code", + "originating_depository_financial_institution_name", + "originating_depository_financial_institution_id_qualifier", + "originating_depository_financial_institution_id", + "originating_depository_financial_institution_branch_country", + "originator_city", + "originator_company_entry_description", + "originator_country", + "originator_identification", + "originator_name", + "originator_postal_code", + "originator_street_address", + "originator_state_or_province", + "payment_related_information", + "payment_related_information2", + "receiver_identification_number", + "receiver_street_address", + "receiver_city", + "receiver_state_or_province", + "receiver_country", + "receiver_postal_code", + "receiving_company_or_individual_name", + "receiving_depository_financial_institution_name", + "receiving_depository_financial_institution_id_qualifier", + "receiving_depository_financial_institution_id", + "receiving_depository_financial_institution_country", + "trace_number" + ], + "title": "International ACH Decline", + "type": "object", + "x-title-plural": "International ACH Declines" + } + }, + "required": [ + "category", + "ach_decline", + "card_decline", + "check_decline", + "inbound_real_time_payments_transfer_decline", + "international_ach_decline", + "card_route_decline" + ], + "title": "Declined Transaction Source", + "type": "object", + "x-title-plural": "Declined Transaction Sources" } Value: - "2020-01-31T00:00:00Z" + { + "ach_decline": { + "amount": 1750, + "originator_company_descriptive_date": null, + "originator_company_discretionary_data": null, + "originator_company_id": "0987654321", + "originator_company_name": "BIG BANK", + "reason": "insufficient_funds", + "receiver_id_number": "12345678900", + "receiver_name": "IAN CREASE", + "trace_number": "021000038461022" + }, + "category": "ach_decline" + } + | Error at "/inbound_real_time_payments_transfer_decline": property "inbound_real_time_payments_transfer_decline" is missing +Schema: + { + "description": "This is an object giving more details on the network-level event that caused the Declined Transaction. For example, for a card transaction this lists the merchant's industry and location. Note that for backwards compatibility reasons, additional undocumented keys may appear in this object. These should be treated as deprecated and will be removed in the future.", + "example": { + "ach_decline": { + "amount": 1750, + "originator_company_descriptive_date": null, + "originator_company_discretionary_data": null, + "originator_company_id": "0987654321", + "originator_company_name": "BIG BANK", + "reason": "insufficient_funds", + "receiver_id_number": "12345678900", + "receiver_name": "IAN CREASE", + "trace_number": "021000038461022" + }, + "category": "ach_decline" + }, + "properties": { + "ach_decline": { + "description": "A ACH Decline object. This field will be present in the JSON response if and only if `category` is equal to `ach_decline`.", + "example": { + "amount": 1750, + "originator_company_descriptive_date": null, + "originator_company_discretionary_data": null, + "originator_company_id": "0987654321", + "originator_company_name": "BIG BANK", + "reason": "insufficient_funds", + "receiver_id_number": "12345678900", + "receiver_name": "IAN CREASE", + "trace_number": "021000038461022" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "originator_company_descriptive_date": { + "nullable": true, + "type": "string" + }, + "originator_company_discretionary_data": { + "nullable": true, + "type": "string" + }, + "originator_company_id": { + "type": "string" + }, + "originator_company_name": { + "type": "string" + }, + "reason": { + "description": "Why the ACH transfer was declined.", + "enum": [ + "ach_route_canceled", + "ach_route_disabled", + "breaches_limit", + "credit_entry_refused_by_receiver", + "duplicate_return", + "entity_not_active", + "group_locked", + "insufficient_funds", + "misrouted_return", + "no_ach_route", + "originator_request", + "transaction_not_allowed" + ], + "type": "string", + "x-enum-descriptions": [ + "The account number is canceled.", + "The account number is disabled.", + "The transaction would cause a limit to be exceeded.", + "A credit was refused.", + "Other.", + "The account's entity is not active.", + "Your account is inactive.", + "Your account contains insufficient funds.", + "Other.", + "The account number that was debited does not exist.", + "Other.", + "The transaction is not allowed per Increase's terms" + ] + }, + "receiver_id_number": { + "nullable": true, + "type": "string" + }, + "receiver_name": { + "nullable": true, + "type": "string" + }, + "trace_number": { + "type": "string" + } + }, + "required": [ + "amount", + "originator_company_name", + "originator_company_descriptive_date", + "originator_company_discretionary_data", + "originator_company_id", + "reason", + "receiver_id_number", + "receiver_name", + "trace_number" + ], + "title": "ACH Decline", + "type": "object", + "x-title-plural": "ACH Declines" + }, + "card_decline": { + "description": "A Card Decline object. This field will be present in the JSON response if and only if `category` is equal to `card_decline`.", + "example": { + "amount": -1000, + "currency": "USD", + "digital_wallet_token_id": null, + "merchant_acceptor_id": "372909060886", + "merchant_category_code": "5998", + "merchant_city": "5364086000", + "merchant_country": "USA", + "merchant_descriptor": "TENTS R US", + "merchant_state": "CA", + "network": "visa", + "network_details": { + "visa": { + "electronic_commerce_indicator": "secure_electronic_commerce", + "point_of_service_entry_mode": "manual" + } + }, + "real_time_decision_id": null, + "reason": "insufficient_funds" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "currency": { + "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination account currency.", + "enum": [ + "CAD", + "CHF", + "EUR", + "GBP", + "JPY", + "USD" + ], + "type": "string", + "x-enum-descriptions": [ + "Canadian Dollar (CAD)", + "Swiss Franc (CHF)", + "Euro (EUR)", + "British Pound (GBP)", + "Japanese Yen (JPY)", + "US Dollar (USD)" + ] + }, + "digital_wallet_token_id": { + "description": "If the authorization was attempted using a Digital Wallet Token (such as an Apple Pay purchase), the identifier of the token that was used.", + "nullable": true, + "type": "string" + }, + "merchant_acceptor_id": { + "description": "The merchant identifier (commonly abbreviated as MID) of the merchant the card is transacting with.", + "type": "string" + }, + "merchant_category_code": { + "description": "The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card is transacting with.", + "nullable": true, + "type": "string" + }, + "merchant_city": { + "description": "The city the merchant resides in.", + "nullable": true, + "type": "string" + }, + "merchant_country": { + "description": "The country the merchant resides in.", + "nullable": true, + "type": "string" + }, + "merchant_descriptor": { + "description": "The merchant descriptor of the merchant the card is transacting with.", + "type": "string" + }, + "merchant_state": { + "description": "The state the merchant resides in.", + "nullable": true, + "type": "string" + }, + "network": { + "description": "The payment network used to process this card authorization", + "enum": [ + "visa" + ], + "type": "string", + "x-enum-descriptions": [ + "Visa" + ] + }, + "network_details": { + "description": "Fields specific to the `network`", + "properties": { + "visa": { + "description": "Fields specific to the `visa` network", + "properties": { + "electronic_commerce_indicator": { + "description": "For electronic commerce transactions, this identifies the level of security used in obtaining the customer's payment credential. For mail or telephone order transactions, identifies the type of mail or telephone order.", + "enum": [ + "mail_phone_order", + "recurring", + "installment", + "unknown_mail_phone_order", + "secure_electronic_commerce", + "non_authenticated_security_transaction_at_3ds_capable_merchant", + "non_authenticated_security_transaction", + "non_secure_transaction" + ], + "nullable": true, + "type": "string", + "x-enum-descriptions": [ + "Single transaction of a mail/phone order: Use to indicate that the transaction is a mail/phone order purchase, not a recurring transaction or installment payment. For domestic transactions in the US region, this value may also indicate one bill payment transaction in the card-present or card-absent environments.", + "Recurring transaction: Payment indicator used to indicate a recurring transaction that originates from an acquirer in the US region.", + "Installment payment: Payment indicator used to indicate one purchase of goods or services that is billed to the account in multiple charges over a period of time agreed upon by the cardholder and merchant from transactions that originate from an acquirer in the US region.", + "Unknown classification: other mail order: Use to indicate that the type of mail/telephone order is unknown.", + "Secure electronic commerce transaction: Use to indicate that the electronic commerce transaction has been authenticated using e.g., 3-D Secure", + "Non-authenticated security transaction at a 3-D Secure-capable merchant, and merchant attempted to authenticate the cardholder using 3-D Secure: Use to identify an electronic commerce transaction where the merchant attempted to authenticate the cardholder using 3-D Secure, but was unable to complete the authentication because the issuer or cardholder does not participate in the 3-D Secure program.", + "Non-authenticated security transaction: Use to identify an electronic commerce transaction that uses data encryption for security however , cardholder authentication is not performed using 3-D Secure.", + "Non-secure transaction: Use to identify an electronic commerce transaction that has no data protection." + ] + }, + "point_of_service_entry_mode": { + "description": "The method used to enter the cardholder's primary account number and card expiration date", + "enum": [ + "manual", + "magnetic_stripe_no_cvv", + "optical_code", + "integrated_circuit_card", + "contactless", + "credential_on_file", + "magnetic_stripe", + "contactless_magnetic_stripe", + "integrated_circuit_card_no_cvv" + ], + "nullable": true, + "type": "string", + "x-enum-descriptions": [ + "Manual key entry", + "Magnetic stripe read, without card verification value", + "Optical code", + "Contact chip card", + "Contactless read of chip card", + "Transaction iniated using a credential that has previously been stored on file", + "Magnetic stripe read", + "Contactless read of magnetic stripe data", + "Contact chip card, without card verification value" + ] + } + }, + "required": [ + "electronic_commerce_indicator", + "point_of_service_entry_mode" + ], + "title": "Visa", + "type": "object", + "x-title-plural": "Visas" + } + }, + "required": [ + "visa" + ], + "title": "Network Details", + "type": "object", + "x-title-plural": "Network Detailss" + }, + "real_time_decision_id": { + "description": "The identifier of the Real-Time Decision sent to approve or decline this transaction.", + "nullable": true, + "type": "string" + }, + "reason": { + "description": "Why the transaction was declined.", + "enum": [ + "card_not_active", + "entity_not_active", + "group_locked", + "insufficient_funds", + "cvv2_mismatch", + "transaction_not_allowed", + "breaches_limit", + "webhook_declined", + "webhook_timed_out", + "declined_by_stand_in_processing", + "invalid_physical_card", + "missing_original_authorization" + ], + "type": "string", + "x-enum-descriptions": [ + "The Card was not active.", + "The account's entity was not active.", + "The account was inactive.", + "The Card's Account did not have a sufficient available balance.", + "The given CVV2 did not match the card's value.", + "The attempted card transaction is not allowed per Increase's terms.", + "The transaction was blocked by a Limit.", + "Your application declined the transaction via webhook.", + "Your application webhook did not respond without the required timeout.", + "Declined by stand-in processing.", + "The card read had an invalid CVV, dCVV, or authorization request cryptogram.", + "The original card authorization for this incremental authorization does not exist." + ] + } + }, + "required": [ + "merchant_acceptor_id", + "merchant_descriptor", + "merchant_category_code", + "merchant_city", + "merchant_country", + "network", + "network_details", + "amount", + "currency", + "reason", + "merchant_state", + "real_time_decision_id", + "digital_wallet_token_id" + ], + "title": "Card Decline", + "type": "object", + "x-title-plural": "Card Declines" + }, + "card_route_decline": { + "description": "A Deprecated Card Decline object. This field will be present in the JSON response if and only if `category` is equal to `card_route_decline`.", + "example": { + "amount": -1000, + "currency": "USD", + "merchant_acceptor_id": "372909060886", + "merchant_category_code": "5998", + "merchant_city": "5364086000", + "merchant_country": "USA", + "merchant_descriptor": "TENTS R US", + "merchant_state": "CA" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "currency": { + "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination account currency.", + "enum": [ + "CAD", + "CHF", + "EUR", + "GBP", + "JPY", + "USD" + ], + "type": "string", + "x-enum-descriptions": [ + "Canadian Dollar (CAD)", + "Swiss Franc (CHF)", + "Euro (EUR)", + "British Pound (GBP)", + "Japanese Yen (JPY)", + "US Dollar (USD)" + ] + }, + "merchant_acceptor_id": { + "type": "string" + }, + "merchant_category_code": { + "nullable": true, + "type": "string" + }, + "merchant_city": { + "nullable": true, + "type": "string" + }, + "merchant_country": { + "type": "string" + }, + "merchant_descriptor": { + "type": "string" + }, + "merchant_state": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "amount", + "currency", + "merchant_acceptor_id", + "merchant_city", + "merchant_country", + "merchant_descriptor", + "merchant_state", + "merchant_category_code" + ], + "title": "Deprecated Card Decline", + "type": "object", + "x-title-plural": "Deprecated Card Declines" + }, + "category": { + "description": "The type of decline that took place. We may add additional possible values for this enum over time; your application should be able to handle such additions gracefully.", + "enum": [ + "ach_decline", + "card_decline", + "check_decline", + "inbound_real_time_payments_transfer_decline", + "international_ach_decline", + "card_route_decline", + "other" + ], + "type": "string", + "x-enum-descriptions": [ + "The Declined Transaction was created by a ACH Decline object. Details will be under the `ach_decline` object.", + "The Declined Transaction was created by a Card Decline object. Details will be under the `card_decline` object.", + "The Declined Transaction was created by a Check Decline object. Details will be under the `check_decline` object.", + "The Declined Transaction was created by a Inbound Real Time Payments Transfer Decline object. Details will be under the `inbound_real_time_payments_transfer_decline` object.", + "The Declined Transaction was created by a International ACH Decline object. Details will be under the `international_ach_decline` object.", + "The Declined Transaction was created by a Deprecated Card Decline object. Details will be under the `card_route_decline` object.", + "The Declined Transaction was made for an undocumented or deprecated reason." + ] + }, + "check_decline": { + "description": "A Check Decline object. This field will be present in the JSON response if and only if `category` is equal to `check_decline`.", + "example": { + "amount": -1000, + "auxiliary_on_us": "99999", + "reason": "insufficient_funds" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "auxiliary_on_us": { + "nullable": true, + "type": "string" + }, + "reason": { + "description": "Why the check was declined.", + "enum": [ + "ach_route_canceled", + "ach_route_disabled", + "breaches_limit", + "entity_not_active", + "group_locked", + "insufficient_funds", + "unable_to_locate_account", + "unable_to_process", + "refer_to_image", + "stop_payment_requested", + "returned", + "duplicate_presentment", + "not_authorized" + ], + "type": "string", + "x-enum-descriptions": [ + "The account number is canceled.", + "The account number is disabled.", + "The transaction would cause a limit to be exceeded.", + "The account's entity is not active.", + "Your account is inactive.", + "Your account contains insufficient funds.", + "Unable to locate account.", + "Unable to process.", + "Refer to image.", + "Stop payment requested for this check.", + "Check was returned to sender.", + "The check was a duplicate deposit.", + "The transaction is not allowed." + ] + } + }, + "required": [ + "amount", + "auxiliary_on_us", + "reason" + ], + "title": "Check Decline", + "type": "object", + "x-title-plural": "Check Declines" + }, + "inbound_real_time_payments_transfer_decline": { + "description": "A Inbound Real Time Payments Transfer Decline object. This field will be present in the JSON response if and only if `category` is equal to `inbound_real_time_payments_transfer_decline`.", + "example": { + "amount": 100, + "creditor_name": "Ian Crease", + "currency": "USD", + "debtor_account_number": "987654321", + "debtor_name": "National Phonograph Company", + "debtor_routing_number": "101050001", + "reason": "account_number_disabled", + "remittance_information": "Invoice 29582", + "transaction_identification": "20220501234567891T1BSLZO01745013025" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "creditor_name": { + "description": "The name the sender of the transfer specified as the recipient of the transfer.", + "type": "string" + }, + "currency": { + "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the declined transfer's currency. This will always be \"USD\" for a Real Time Payments transfer.", + "enum": [ + "CAD", + "CHF", + "EUR", + "GBP", + "JPY", + "USD" + ], + "type": "string", + "x-enum-descriptions": [ + "Canadian Dollar (CAD)", + "Swiss Franc (CHF)", + "Euro (EUR)", + "British Pound (GBP)", + "Japanese Yen (JPY)", + "US Dollar (USD)" + ] + }, + "debtor_account_number": { + "description": "The account number of the account that sent the transfer.", + "type": "string" + }, + "debtor_name": { + "description": "The name provided by the sender of the transfer.", + "type": "string" + }, + "debtor_routing_number": { + "description": "The routing number of the account that sent the transfer.", + "type": "string" + }, + "reason": { + "description": "Why the transfer was declined.", + "enum": [ + "account_number_canceled", + "account_number_disabled", + "group_locked", + "entity_not_active", + "real_time_payments_not_enabled" + ], + "type": "string", + "x-enum-descriptions": [ + "The account number is canceled.", + "The account number is disabled.", + "Your account is inactive.", + "The account's entity is not active.", + "Your account is not enabled to receive Real Time Payments transfers." + ] + }, + "remittance_information": { + "description": "Additional information included with the transfer.", + "nullable": true, + "type": "string" + }, + "transaction_identification": { + "description": "The Real Time Payments network identification of the declined transfer.", + "type": "string" + } + }, + "required": [ + "amount", + "currency", + "reason", + "creditor_name", + "debtor_name", + "debtor_account_number", + "debtor_routing_number", + "transaction_identification", + "remittance_information" + ], + "title": "Inbound Real Time Payments Transfer Decline", + "type": "object", + "x-title-plural": "Inbound Real Time Payments Transfer Declines" + }, + "international_ach_decline": { + "description": "A International ACH Decline object. This field will be present in the JSON response if and only if `category` is equal to `international_ach_decline`.", + "example": { + "amount": -1000, + "destination_country_code": "US", + "destination_currency_code": "USD", + "foreign_exchange_indicator": "fixed_to_fixed", + "foreign_exchange_reference": null, + "foreign_exchange_reference_indicator": "blank", + "foreign_payment_amount": 199, + "foreign_trace_number": null, + "international_transaction_type_code": "internet_initiated", + "originating_currency_code": "USD", + "originating_depository_financial_institution_branch_country": "US", + "originating_depository_financial_institution_id": "091000019", + "originating_depository_financial_institution_id_qualifier": "national_clearing_system_number", + "originating_depository_financial_institution_name": "WELLS FARGO BANK", + "originator_city": "BERLIN", + "originator_company_entry_description": "RETRY PYMT", + "originator_country": "DE", + "originator_identification": "770510487A", + "originator_name": "BERGHAIN", + "originator_postal_code": "50825", + "originator_state_or_province": null, + "originator_street_address": "Ruedersdorferstr. 7", + "payment_related_information": null, + "payment_related_information2": null, + "receiver_city": "BEVERLY HILLS", + "receiver_country": "US", + "receiver_identification_number": "1018790279274", + "receiver_postal_code": "90210", + "receiver_state_or_province": "CA", + "receiver_street_address": "123 FAKE ST", + "receiving_company_or_individual_name": "IAN CREASE", + "receiving_depository_financial_institution_country": "US", + "receiving_depository_financial_institution_id": "101050001", + "receiving_depository_financial_institution_id_qualifier": "national_clearing_system_number", + "receiving_depository_financial_institution_name": "BLUE RIDGE BANK, NATIONAL ASSOCIATI", + "trace_number": "010202909100090" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "destination_country_code": { + "type": "string" + }, + "destination_currency_code": { + "type": "string" + }, + "foreign_exchange_indicator": { + "type": "string" + }, + "foreign_exchange_reference": { + "nullable": true, + "type": "string" + }, + "foreign_exchange_reference_indicator": { + "type": "string" + }, + "foreign_payment_amount": { + "type": "integer" + }, + "foreign_trace_number": { + "nullable": true, + "type": "string" + }, + "international_transaction_type_code": { + "type": "string" + }, + "originating_currency_code": { + "type": "string" + }, + "originating_depository_financial_institution_branch_country": { + "type": "string" + }, + "originating_depository_financial_institution_id": { + "type": "string" + }, + "originating_depository_financial_institution_id_qualifier": { + "type": "string" + }, + "originating_depository_financial_institution_name": { + "type": "string" + }, + "originator_city": { + "type": "string" + }, + "originator_company_entry_description": { + "type": "string" + }, + "originator_country": { + "type": "string" + }, + "originator_identification": { + "type": "string" + }, + "originator_name": { + "type": "string" + }, + "originator_postal_code": { + "nullable": true, + "type": "string" + }, + "originator_state_or_province": { + "nullable": true, + "type": "string" + }, + "originator_street_address": { + "type": "string" + }, + "payment_related_information": { + "nullable": true, + "type": "string" + }, + "payment_related_information2": { + "nullable": true, + "type": "string" + }, + "receiver_city": { + "type": "string" + }, + "receiver_country": { + "type": "string" + }, + "receiver_identification_number": { + "nullable": true, + "type": "string" + }, + "receiver_postal_code": { + "nullable": true, + "type": "string" + }, + "receiver_state_or_province": { + "nullable": true, + "type": "string" + }, + "receiver_street_address": { + "type": "string" + }, + "receiving_company_or_individual_name": { + "type": "string" + }, + "receiving_depository_financial_institution_country": { + "type": "string" + }, + "receiving_depository_financial_institution_id": { + "type": "string" + }, + "receiving_depository_financial_institution_id_qualifier": { + "type": "string" + }, + "receiving_depository_financial_institution_name": { + "type": "string" + }, + "trace_number": { + "type": "string" + } + }, + "required": [ + "amount", + "foreign_exchange_indicator", + "foreign_exchange_reference_indicator", + "foreign_exchange_reference", + "destination_country_code", + "destination_currency_code", + "foreign_payment_amount", + "foreign_trace_number", + "international_transaction_type_code", + "originating_currency_code", + "originating_depository_financial_institution_name", + "originating_depository_financial_institution_id_qualifier", + "originating_depository_financial_institution_id", + "originating_depository_financial_institution_branch_country", + "originator_city", + "originator_company_entry_description", + "originator_country", + "originator_identification", + "originator_name", + "originator_postal_code", + "originator_street_address", + "originator_state_or_province", + "payment_related_information", + "payment_related_information2", + "receiver_identification_number", + "receiver_street_address", + "receiver_city", + "receiver_state_or_province", + "receiver_country", + "receiver_postal_code", + "receiving_company_or_individual_name", + "receiving_depository_financial_institution_name", + "receiving_depository_financial_institution_id_qualifier", + "receiving_depository_financial_institution_id", + "receiving_depository_financial_institution_country", + "trace_number" + ], + "title": "International ACH Decline", + "type": "object", + "x-title-plural": "International ACH Declines" + } + }, + "required": [ + "category", + "ach_decline", + "card_decline", + "check_decline", + "inbound_real_time_payments_transfer_decline", + "international_ach_decline", + "card_route_decline" + ], + "title": "Declined Transaction Source", + "type": "object", + "x-title-plural": "Declined Transaction Sources" + } + +Value: + { + "ach_decline": { + "amount": 1750, + "originator_company_descriptive_date": null, + "originator_company_discretionary_data": null, + "originator_company_id": "0987654321", + "originator_company_name": "BIG BANK", + "reason": "insufficient_funds", + "receiver_id_number": "12345678900", + "receiver_name": "IAN CREASE", + "trace_number": "021000038461022" + }, + "category": "ach_decline" + } + | Error at "/international_ach_decline": property "international_ach_decline" is missing +Schema: + { + "description": "This is an object giving more details on the network-level event that caused the Declined Transaction. For example, for a card transaction this lists the merchant's industry and location. Note that for backwards compatibility reasons, additional undocumented keys may appear in this object. These should be treated as deprecated and will be removed in the future.", + "example": { + "ach_decline": { + "amount": 1750, + "originator_company_descriptive_date": null, + "originator_company_discretionary_data": null, + "originator_company_id": "0987654321", + "originator_company_name": "BIG BANK", + "reason": "insufficient_funds", + "receiver_id_number": "12345678900", + "receiver_name": "IAN CREASE", + "trace_number": "021000038461022" + }, + "category": "ach_decline" + }, + "properties": { + "ach_decline": { + "description": "A ACH Decline object. This field will be present in the JSON response if and only if `category` is equal to `ach_decline`.", + "example": { + "amount": 1750, + "originator_company_descriptive_date": null, + "originator_company_discretionary_data": null, + "originator_company_id": "0987654321", + "originator_company_name": "BIG BANK", + "reason": "insufficient_funds", + "receiver_id_number": "12345678900", + "receiver_name": "IAN CREASE", + "trace_number": "021000038461022" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "originator_company_descriptive_date": { + "nullable": true, + "type": "string" + }, + "originator_company_discretionary_data": { + "nullable": true, + "type": "string" + }, + "originator_company_id": { + "type": "string" + }, + "originator_company_name": { + "type": "string" + }, + "reason": { + "description": "Why the ACH transfer was declined.", + "enum": [ + "ach_route_canceled", + "ach_route_disabled", + "breaches_limit", + "credit_entry_refused_by_receiver", + "duplicate_return", + "entity_not_active", + "group_locked", + "insufficient_funds", + "misrouted_return", + "no_ach_route", + "originator_request", + "transaction_not_allowed" + ], + "type": "string", + "x-enum-descriptions": [ + "The account number is canceled.", + "The account number is disabled.", + "The transaction would cause a limit to be exceeded.", + "A credit was refused.", + "Other.", + "The account's entity is not active.", + "Your account is inactive.", + "Your account contains insufficient funds.", + "Other.", + "The account number that was debited does not exist.", + "Other.", + "The transaction is not allowed per Increase's terms" + ] + }, + "receiver_id_number": { + "nullable": true, + "type": "string" + }, + "receiver_name": { + "nullable": true, + "type": "string" + }, + "trace_number": { + "type": "string" + } + }, + "required": [ + "amount", + "originator_company_name", + "originator_company_descriptive_date", + "originator_company_discretionary_data", + "originator_company_id", + "reason", + "receiver_id_number", + "receiver_name", + "trace_number" + ], + "title": "ACH Decline", + "type": "object", + "x-title-plural": "ACH Declines" + }, + "card_decline": { + "description": "A Card Decline object. This field will be present in the JSON response if and only if `category` is equal to `card_decline`.", + "example": { + "amount": -1000, + "currency": "USD", + "digital_wallet_token_id": null, + "merchant_acceptor_id": "372909060886", + "merchant_category_code": "5998", + "merchant_city": "5364086000", + "merchant_country": "USA", + "merchant_descriptor": "TENTS R US", + "merchant_state": "CA", + "network": "visa", + "network_details": { + "visa": { + "electronic_commerce_indicator": "secure_electronic_commerce", + "point_of_service_entry_mode": "manual" + } + }, + "real_time_decision_id": null, + "reason": "insufficient_funds" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "currency": { + "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination account currency.", + "enum": [ + "CAD", + "CHF", + "EUR", + "GBP", + "JPY", + "USD" + ], + "type": "string", + "x-enum-descriptions": [ + "Canadian Dollar (CAD)", + "Swiss Franc (CHF)", + "Euro (EUR)", + "British Pound (GBP)", + "Japanese Yen (JPY)", + "US Dollar (USD)" + ] + }, + "digital_wallet_token_id": { + "description": "If the authorization was attempted using a Digital Wallet Token (such as an Apple Pay purchase), the identifier of the token that was used.", + "nullable": true, + "type": "string" + }, + "merchant_acceptor_id": { + "description": "The merchant identifier (commonly abbreviated as MID) of the merchant the card is transacting with.", + "type": "string" + }, + "merchant_category_code": { + "description": "The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card is transacting with.", + "nullable": true, + "type": "string" + }, + "merchant_city": { + "description": "The city the merchant resides in.", + "nullable": true, + "type": "string" + }, + "merchant_country": { + "description": "The country the merchant resides in.", + "nullable": true, + "type": "string" + }, + "merchant_descriptor": { + "description": "The merchant descriptor of the merchant the card is transacting with.", + "type": "string" + }, + "merchant_state": { + "description": "The state the merchant resides in.", + "nullable": true, + "type": "string" + }, + "network": { + "description": "The payment network used to process this card authorization", + "enum": [ + "visa" + ], + "type": "string", + "x-enum-descriptions": [ + "Visa" + ] + }, + "network_details": { + "description": "Fields specific to the `network`", + "properties": { + "visa": { + "description": "Fields specific to the `visa` network", + "properties": { + "electronic_commerce_indicator": { + "description": "For electronic commerce transactions, this identifies the level of security used in obtaining the customer's payment credential. For mail or telephone order transactions, identifies the type of mail or telephone order.", + "enum": [ + "mail_phone_order", + "recurring", + "installment", + "unknown_mail_phone_order", + "secure_electronic_commerce", + "non_authenticated_security_transaction_at_3ds_capable_merchant", + "non_authenticated_security_transaction", + "non_secure_transaction" + ], + "nullable": true, + "type": "string", + "x-enum-descriptions": [ + "Single transaction of a mail/phone order: Use to indicate that the transaction is a mail/phone order purchase, not a recurring transaction or installment payment. For domestic transactions in the US region, this value may also indicate one bill payment transaction in the card-present or card-absent environments.", + "Recurring transaction: Payment indicator used to indicate a recurring transaction that originates from an acquirer in the US region.", + "Installment payment: Payment indicator used to indicate one purchase of goods or services that is billed to the account in multiple charges over a period of time agreed upon by the cardholder and merchant from transactions that originate from an acquirer in the US region.", + "Unknown classification: other mail order: Use to indicate that the type of mail/telephone order is unknown.", + "Secure electronic commerce transaction: Use to indicate that the electronic commerce transaction has been authenticated using e.g., 3-D Secure", + "Non-authenticated security transaction at a 3-D Secure-capable merchant, and merchant attempted to authenticate the cardholder using 3-D Secure: Use to identify an electronic commerce transaction where the merchant attempted to authenticate the cardholder using 3-D Secure, but was unable to complete the authentication because the issuer or cardholder does not participate in the 3-D Secure program.", + "Non-authenticated security transaction: Use to identify an electronic commerce transaction that uses data encryption for security however , cardholder authentication is not performed using 3-D Secure.", + "Non-secure transaction: Use to identify an electronic commerce transaction that has no data protection." + ] + }, + "point_of_service_entry_mode": { + "description": "The method used to enter the cardholder's primary account number and card expiration date", + "enum": [ + "manual", + "magnetic_stripe_no_cvv", + "optical_code", + "integrated_circuit_card", + "contactless", + "credential_on_file", + "magnetic_stripe", + "contactless_magnetic_stripe", + "integrated_circuit_card_no_cvv" + ], + "nullable": true, + "type": "string", + "x-enum-descriptions": [ + "Manual key entry", + "Magnetic stripe read, without card verification value", + "Optical code", + "Contact chip card", + "Contactless read of chip card", + "Transaction iniated using a credential that has previously been stored on file", + "Magnetic stripe read", + "Contactless read of magnetic stripe data", + "Contact chip card, without card verification value" + ] + } + }, + "required": [ + "electronic_commerce_indicator", + "point_of_service_entry_mode" + ], + "title": "Visa", + "type": "object", + "x-title-plural": "Visas" + } + }, + "required": [ + "visa" + ], + "title": "Network Details", + "type": "object", + "x-title-plural": "Network Detailss" + }, + "real_time_decision_id": { + "description": "The identifier of the Real-Time Decision sent to approve or decline this transaction.", + "nullable": true, + "type": "string" + }, + "reason": { + "description": "Why the transaction was declined.", + "enum": [ + "card_not_active", + "entity_not_active", + "group_locked", + "insufficient_funds", + "cvv2_mismatch", + "transaction_not_allowed", + "breaches_limit", + "webhook_declined", + "webhook_timed_out", + "declined_by_stand_in_processing", + "invalid_physical_card", + "missing_original_authorization" + ], + "type": "string", + "x-enum-descriptions": [ + "The Card was not active.", + "The account's entity was not active.", + "The account was inactive.", + "The Card's Account did not have a sufficient available balance.", + "The given CVV2 did not match the card's value.", + "The attempted card transaction is not allowed per Increase's terms.", + "The transaction was blocked by a Limit.", + "Your application declined the transaction via webhook.", + "Your application webhook did not respond without the required timeout.", + "Declined by stand-in processing.", + "The card read had an invalid CVV, dCVV, or authorization request cryptogram.", + "The original card authorization for this incremental authorization does not exist." + ] + } + }, + "required": [ + "merchant_acceptor_id", + "merchant_descriptor", + "merchant_category_code", + "merchant_city", + "merchant_country", + "network", + "network_details", + "amount", + "currency", + "reason", + "merchant_state", + "real_time_decision_id", + "digital_wallet_token_id" + ], + "title": "Card Decline", + "type": "object", + "x-title-plural": "Card Declines" + }, + "card_route_decline": { + "description": "A Deprecated Card Decline object. This field will be present in the JSON response if and only if `category` is equal to `card_route_decline`.", + "example": { + "amount": -1000, + "currency": "USD", + "merchant_acceptor_id": "372909060886", + "merchant_category_code": "5998", + "merchant_city": "5364086000", + "merchant_country": "USA", + "merchant_descriptor": "TENTS R US", + "merchant_state": "CA" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "currency": { + "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination account currency.", + "enum": [ + "CAD", + "CHF", + "EUR", + "GBP", + "JPY", + "USD" + ], + "type": "string", + "x-enum-descriptions": [ + "Canadian Dollar (CAD)", + "Swiss Franc (CHF)", + "Euro (EUR)", + "British Pound (GBP)", + "Japanese Yen (JPY)", + "US Dollar (USD)" + ] + }, + "merchant_acceptor_id": { + "type": "string" + }, + "merchant_category_code": { + "nullable": true, + "type": "string" + }, + "merchant_city": { + "nullable": true, + "type": "string" + }, + "merchant_country": { + "type": "string" + }, + "merchant_descriptor": { + "type": "string" + }, + "merchant_state": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "amount", + "currency", + "merchant_acceptor_id", + "merchant_city", + "merchant_country", + "merchant_descriptor", + "merchant_state", + "merchant_category_code" + ], + "title": "Deprecated Card Decline", + "type": "object", + "x-title-plural": "Deprecated Card Declines" + }, + "category": { + "description": "The type of decline that took place. We may add additional possible values for this enum over time; your application should be able to handle such additions gracefully.", + "enum": [ + "ach_decline", + "card_decline", + "check_decline", + "inbound_real_time_payments_transfer_decline", + "international_ach_decline", + "card_route_decline", + "other" + ], + "type": "string", + "x-enum-descriptions": [ + "The Declined Transaction was created by a ACH Decline object. Details will be under the `ach_decline` object.", + "The Declined Transaction was created by a Card Decline object. Details will be under the `card_decline` object.", + "The Declined Transaction was created by a Check Decline object. Details will be under the `check_decline` object.", + "The Declined Transaction was created by a Inbound Real Time Payments Transfer Decline object. Details will be under the `inbound_real_time_payments_transfer_decline` object.", + "The Declined Transaction was created by a International ACH Decline object. Details will be under the `international_ach_decline` object.", + "The Declined Transaction was created by a Deprecated Card Decline object. Details will be under the `card_route_decline` object.", + "The Declined Transaction was made for an undocumented or deprecated reason." + ] + }, + "check_decline": { + "description": "A Check Decline object. This field will be present in the JSON response if and only if `category` is equal to `check_decline`.", + "example": { + "amount": -1000, + "auxiliary_on_us": "99999", + "reason": "insufficient_funds" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "auxiliary_on_us": { + "nullable": true, + "type": "string" + }, + "reason": { + "description": "Why the check was declined.", + "enum": [ + "ach_route_canceled", + "ach_route_disabled", + "breaches_limit", + "entity_not_active", + "group_locked", + "insufficient_funds", + "unable_to_locate_account", + "unable_to_process", + "refer_to_image", + "stop_payment_requested", + "returned", + "duplicate_presentment", + "not_authorized" + ], + "type": "string", + "x-enum-descriptions": [ + "The account number is canceled.", + "The account number is disabled.", + "The transaction would cause a limit to be exceeded.", + "The account's entity is not active.", + "Your account is inactive.", + "Your account contains insufficient funds.", + "Unable to locate account.", + "Unable to process.", + "Refer to image.", + "Stop payment requested for this check.", + "Check was returned to sender.", + "The check was a duplicate deposit.", + "The transaction is not allowed." + ] + } + }, + "required": [ + "amount", + "auxiliary_on_us", + "reason" + ], + "title": "Check Decline", + "type": "object", + "x-title-plural": "Check Declines" + }, + "inbound_real_time_payments_transfer_decline": { + "description": "A Inbound Real Time Payments Transfer Decline object. This field will be present in the JSON response if and only if `category` is equal to `inbound_real_time_payments_transfer_decline`.", + "example": { + "amount": 100, + "creditor_name": "Ian Crease", + "currency": "USD", + "debtor_account_number": "987654321", + "debtor_name": "National Phonograph Company", + "debtor_routing_number": "101050001", + "reason": "account_number_disabled", + "remittance_information": "Invoice 29582", + "transaction_identification": "20220501234567891T1BSLZO01745013025" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "creditor_name": { + "description": "The name the sender of the transfer specified as the recipient of the transfer.", + "type": "string" + }, + "currency": { + "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the declined transfer's currency. This will always be \"USD\" for a Real Time Payments transfer.", + "enum": [ + "CAD", + "CHF", + "EUR", + "GBP", + "JPY", + "USD" + ], + "type": "string", + "x-enum-descriptions": [ + "Canadian Dollar (CAD)", + "Swiss Franc (CHF)", + "Euro (EUR)", + "British Pound (GBP)", + "Japanese Yen (JPY)", + "US Dollar (USD)" + ] + }, + "debtor_account_number": { + "description": "The account number of the account that sent the transfer.", + "type": "string" + }, + "debtor_name": { + "description": "The name provided by the sender of the transfer.", + "type": "string" + }, + "debtor_routing_number": { + "description": "The routing number of the account that sent the transfer.", + "type": "string" + }, + "reason": { + "description": "Why the transfer was declined.", + "enum": [ + "account_number_canceled", + "account_number_disabled", + "group_locked", + "entity_not_active", + "real_time_payments_not_enabled" + ], + "type": "string", + "x-enum-descriptions": [ + "The account number is canceled.", + "The account number is disabled.", + "Your account is inactive.", + "The account's entity is not active.", + "Your account is not enabled to receive Real Time Payments transfers." + ] + }, + "remittance_information": { + "description": "Additional information included with the transfer.", + "nullable": true, + "type": "string" + }, + "transaction_identification": { + "description": "The Real Time Payments network identification of the declined transfer.", + "type": "string" + } + }, + "required": [ + "amount", + "currency", + "reason", + "creditor_name", + "debtor_name", + "debtor_account_number", + "debtor_routing_number", + "transaction_identification", + "remittance_information" + ], + "title": "Inbound Real Time Payments Transfer Decline", + "type": "object", + "x-title-plural": "Inbound Real Time Payments Transfer Declines" + }, + "international_ach_decline": { + "description": "A International ACH Decline object. This field will be present in the JSON response if and only if `category` is equal to `international_ach_decline`.", + "example": { + "amount": -1000, + "destination_country_code": "US", + "destination_currency_code": "USD", + "foreign_exchange_indicator": "fixed_to_fixed", + "foreign_exchange_reference": null, + "foreign_exchange_reference_indicator": "blank", + "foreign_payment_amount": 199, + "foreign_trace_number": null, + "international_transaction_type_code": "internet_initiated", + "originating_currency_code": "USD", + "originating_depository_financial_institution_branch_country": "US", + "originating_depository_financial_institution_id": "091000019", + "originating_depository_financial_institution_id_qualifier": "national_clearing_system_number", + "originating_depository_financial_institution_name": "WELLS FARGO BANK", + "originator_city": "BERLIN", + "originator_company_entry_description": "RETRY PYMT", + "originator_country": "DE", + "originator_identification": "770510487A", + "originator_name": "BERGHAIN", + "originator_postal_code": "50825", + "originator_state_or_province": null, + "originator_street_address": "Ruedersdorferstr. 7", + "payment_related_information": null, + "payment_related_information2": null, + "receiver_city": "BEVERLY HILLS", + "receiver_country": "US", + "receiver_identification_number": "1018790279274", + "receiver_postal_code": "90210", + "receiver_state_or_province": "CA", + "receiver_street_address": "123 FAKE ST", + "receiving_company_or_individual_name": "IAN CREASE", + "receiving_depository_financial_institution_country": "US", + "receiving_depository_financial_institution_id": "101050001", + "receiving_depository_financial_institution_id_qualifier": "national_clearing_system_number", + "receiving_depository_financial_institution_name": "BLUE RIDGE BANK, NATIONAL ASSOCIATI", + "trace_number": "010202909100090" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "destination_country_code": { + "type": "string" + }, + "destination_currency_code": { + "type": "string" + }, + "foreign_exchange_indicator": { + "type": "string" + }, + "foreign_exchange_reference": { + "nullable": true, + "type": "string" + }, + "foreign_exchange_reference_indicator": { + "type": "string" + }, + "foreign_payment_amount": { + "type": "integer" + }, + "foreign_trace_number": { + "nullable": true, + "type": "string" + }, + "international_transaction_type_code": { + "type": "string" + }, + "originating_currency_code": { + "type": "string" + }, + "originating_depository_financial_institution_branch_country": { + "type": "string" + }, + "originating_depository_financial_institution_id": { + "type": "string" + }, + "originating_depository_financial_institution_id_qualifier": { + "type": "string" + }, + "originating_depository_financial_institution_name": { + "type": "string" + }, + "originator_city": { + "type": "string" + }, + "originator_company_entry_description": { + "type": "string" + }, + "originator_country": { + "type": "string" + }, + "originator_identification": { + "type": "string" + }, + "originator_name": { + "type": "string" + }, + "originator_postal_code": { + "nullable": true, + "type": "string" + }, + "originator_state_or_province": { + "nullable": true, + "type": "string" + }, + "originator_street_address": { + "type": "string" + }, + "payment_related_information": { + "nullable": true, + "type": "string" + }, + "payment_related_information2": { + "nullable": true, + "type": "string" + }, + "receiver_city": { + "type": "string" + }, + "receiver_country": { + "type": "string" + }, + "receiver_identification_number": { + "nullable": true, + "type": "string" + }, + "receiver_postal_code": { + "nullable": true, + "type": "string" + }, + "receiver_state_or_province": { + "nullable": true, + "type": "string" + }, + "receiver_street_address": { + "type": "string" + }, + "receiving_company_or_individual_name": { + "type": "string" + }, + "receiving_depository_financial_institution_country": { + "type": "string" + }, + "receiving_depository_financial_institution_id": { + "type": "string" + }, + "receiving_depository_financial_institution_id_qualifier": { + "type": "string" + }, + "receiving_depository_financial_institution_name": { + "type": "string" + }, + "trace_number": { + "type": "string" + } + }, + "required": [ + "amount", + "foreign_exchange_indicator", + "foreign_exchange_reference_indicator", + "foreign_exchange_reference", + "destination_country_code", + "destination_currency_code", + "foreign_payment_amount", + "foreign_trace_number", + "international_transaction_type_code", + "originating_currency_code", + "originating_depository_financial_institution_name", + "originating_depository_financial_institution_id_qualifier", + "originating_depository_financial_institution_id", + "originating_depository_financial_institution_branch_country", + "originator_city", + "originator_company_entry_description", + "originator_country", + "originator_identification", + "originator_name", + "originator_postal_code", + "originator_street_address", + "originator_state_or_province", + "payment_related_information", + "payment_related_information2", + "receiver_identification_number", + "receiver_street_address", + "receiver_city", + "receiver_state_or_province", + "receiver_country", + "receiver_postal_code", + "receiving_company_or_individual_name", + "receiving_depository_financial_institution_name", + "receiving_depository_financial_institution_id_qualifier", + "receiving_depository_financial_institution_id", + "receiving_depository_financial_institution_country", + "trace_number" + ], + "title": "International ACH Decline", + "type": "object", + "x-title-plural": "International ACH Declines" + } + }, + "required": [ + "category", + "ach_decline", + "card_decline", + "check_decline", + "inbound_real_time_payments_transfer_decline", + "international_ach_decline", + "card_route_decline" + ], + "title": "Declined Transaction Source", + "type": "object", + "x-title-plural": "Declined Transaction Sources" + } + +Value: + { + "ach_decline": { + "amount": 1750, + "originator_company_descriptive_date": null, + "originator_company_discretionary_data": null, + "originator_company_id": "0987654321", + "originator_company_name": "BIG BANK", + "reason": "insufficient_funds", + "receiver_id_number": "12345678900", + "receiver_name": "IAN CREASE", + "trace_number": "021000038461022" + }, + "category": "ach_decline" + } + | Error at "/card_route_decline": property "card_route_decline" is missing +Schema: + { + "description": "This is an object giving more details on the network-level event that caused the Declined Transaction. For example, for a card transaction this lists the merchant's industry and location. Note that for backwards compatibility reasons, additional undocumented keys may appear in this object. These should be treated as deprecated and will be removed in the future.", + "example": { + "ach_decline": { + "amount": 1750, + "originator_company_descriptive_date": null, + "originator_company_discretionary_data": null, + "originator_company_id": "0987654321", + "originator_company_name": "BIG BANK", + "reason": "insufficient_funds", + "receiver_id_number": "12345678900", + "receiver_name": "IAN CREASE", + "trace_number": "021000038461022" + }, + "category": "ach_decline" + }, + "properties": { + "ach_decline": { + "description": "A ACH Decline object. This field will be present in the JSON response if and only if `category` is equal to `ach_decline`.", + "example": { + "amount": 1750, + "originator_company_descriptive_date": null, + "originator_company_discretionary_data": null, + "originator_company_id": "0987654321", + "originator_company_name": "BIG BANK", + "reason": "insufficient_funds", + "receiver_id_number": "12345678900", + "receiver_name": "IAN CREASE", + "trace_number": "021000038461022" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "originator_company_descriptive_date": { + "nullable": true, + "type": "string" + }, + "originator_company_discretionary_data": { + "nullable": true, + "type": "string" + }, + "originator_company_id": { + "type": "string" + }, + "originator_company_name": { + "type": "string" + }, + "reason": { + "description": "Why the ACH transfer was declined.", + "enum": [ + "ach_route_canceled", + "ach_route_disabled", + "breaches_limit", + "credit_entry_refused_by_receiver", + "duplicate_return", + "entity_not_active", + "group_locked", + "insufficient_funds", + "misrouted_return", + "no_ach_route", + "originator_request", + "transaction_not_allowed" + ], + "type": "string", + "x-enum-descriptions": [ + "The account number is canceled.", + "The account number is disabled.", + "The transaction would cause a limit to be exceeded.", + "A credit was refused.", + "Other.", + "The account's entity is not active.", + "Your account is inactive.", + "Your account contains insufficient funds.", + "Other.", + "The account number that was debited does not exist.", + "Other.", + "The transaction is not allowed per Increase's terms" + ] + }, + "receiver_id_number": { + "nullable": true, + "type": "string" + }, + "receiver_name": { + "nullable": true, + "type": "string" + }, + "trace_number": { + "type": "string" + } + }, + "required": [ + "amount", + "originator_company_name", + "originator_company_descriptive_date", + "originator_company_discretionary_data", + "originator_company_id", + "reason", + "receiver_id_number", + "receiver_name", + "trace_number" + ], + "title": "ACH Decline", + "type": "object", + "x-title-plural": "ACH Declines" + }, + "card_decline": { + "description": "A Card Decline object. This field will be present in the JSON response if and only if `category` is equal to `card_decline`.", + "example": { + "amount": -1000, + "currency": "USD", + "digital_wallet_token_id": null, + "merchant_acceptor_id": "372909060886", + "merchant_category_code": "5998", + "merchant_city": "5364086000", + "merchant_country": "USA", + "merchant_descriptor": "TENTS R US", + "merchant_state": "CA", + "network": "visa", + "network_details": { + "visa": { + "electronic_commerce_indicator": "secure_electronic_commerce", + "point_of_service_entry_mode": "manual" + } + }, + "real_time_decision_id": null, + "reason": "insufficient_funds" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "currency": { + "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination account currency.", + "enum": [ + "CAD", + "CHF", + "EUR", + "GBP", + "JPY", + "USD" + ], + "type": "string", + "x-enum-descriptions": [ + "Canadian Dollar (CAD)", + "Swiss Franc (CHF)", + "Euro (EUR)", + "British Pound (GBP)", + "Japanese Yen (JPY)", + "US Dollar (USD)" + ] + }, + "digital_wallet_token_id": { + "description": "If the authorization was attempted using a Digital Wallet Token (such as an Apple Pay purchase), the identifier of the token that was used.", + "nullable": true, + "type": "string" + }, + "merchant_acceptor_id": { + "description": "The merchant identifier (commonly abbreviated as MID) of the merchant the card is transacting with.", + "type": "string" + }, + "merchant_category_code": { + "description": "The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card is transacting with.", + "nullable": true, + "type": "string" + }, + "merchant_city": { + "description": "The city the merchant resides in.", + "nullable": true, + "type": "string" + }, + "merchant_country": { + "description": "The country the merchant resides in.", + "nullable": true, + "type": "string" + }, + "merchant_descriptor": { + "description": "The merchant descriptor of the merchant the card is transacting with.", + "type": "string" + }, + "merchant_state": { + "description": "The state the merchant resides in.", + "nullable": true, + "type": "string" + }, + "network": { + "description": "The payment network used to process this card authorization", + "enum": [ + "visa" + ], + "type": "string", + "x-enum-descriptions": [ + "Visa" + ] + }, + "network_details": { + "description": "Fields specific to the `network`", + "properties": { + "visa": { + "description": "Fields specific to the `visa` network", + "properties": { + "electronic_commerce_indicator": { + "description": "For electronic commerce transactions, this identifies the level of security used in obtaining the customer's payment credential. For mail or telephone order transactions, identifies the type of mail or telephone order.", + "enum": [ + "mail_phone_order", + "recurring", + "installment", + "unknown_mail_phone_order", + "secure_electronic_commerce", + "non_authenticated_security_transaction_at_3ds_capable_merchant", + "non_authenticated_security_transaction", + "non_secure_transaction" + ], + "nullable": true, + "type": "string", + "x-enum-descriptions": [ + "Single transaction of a mail/phone order: Use to indicate that the transaction is a mail/phone order purchase, not a recurring transaction or installment payment. For domestic transactions in the US region, this value may also indicate one bill payment transaction in the card-present or card-absent environments.", + "Recurring transaction: Payment indicator used to indicate a recurring transaction that originates from an acquirer in the US region.", + "Installment payment: Payment indicator used to indicate one purchase of goods or services that is billed to the account in multiple charges over a period of time agreed upon by the cardholder and merchant from transactions that originate from an acquirer in the US region.", + "Unknown classification: other mail order: Use to indicate that the type of mail/telephone order is unknown.", + "Secure electronic commerce transaction: Use to indicate that the electronic commerce transaction has been authenticated using e.g., 3-D Secure", + "Non-authenticated security transaction at a 3-D Secure-capable merchant, and merchant attempted to authenticate the cardholder using 3-D Secure: Use to identify an electronic commerce transaction where the merchant attempted to authenticate the cardholder using 3-D Secure, but was unable to complete the authentication because the issuer or cardholder does not participate in the 3-D Secure program.", + "Non-authenticated security transaction: Use to identify an electronic commerce transaction that uses data encryption for security however , cardholder authentication is not performed using 3-D Secure.", + "Non-secure transaction: Use to identify an electronic commerce transaction that has no data protection." + ] + }, + "point_of_service_entry_mode": { + "description": "The method used to enter the cardholder's primary account number and card expiration date", + "enum": [ + "manual", + "magnetic_stripe_no_cvv", + "optical_code", + "integrated_circuit_card", + "contactless", + "credential_on_file", + "magnetic_stripe", + "contactless_magnetic_stripe", + "integrated_circuit_card_no_cvv" + ], + "nullable": true, + "type": "string", + "x-enum-descriptions": [ + "Manual key entry", + "Magnetic stripe read, without card verification value", + "Optical code", + "Contact chip card", + "Contactless read of chip card", + "Transaction iniated using a credential that has previously been stored on file", + "Magnetic stripe read", + "Contactless read of magnetic stripe data", + "Contact chip card, without card verification value" + ] + } + }, + "required": [ + "electronic_commerce_indicator", + "point_of_service_entry_mode" + ], + "title": "Visa", + "type": "object", + "x-title-plural": "Visas" + } + }, + "required": [ + "visa" + ], + "title": "Network Details", + "type": "object", + "x-title-plural": "Network Detailss" + }, + "real_time_decision_id": { + "description": "The identifier of the Real-Time Decision sent to approve or decline this transaction.", + "nullable": true, + "type": "string" + }, + "reason": { + "description": "Why the transaction was declined.", + "enum": [ + "card_not_active", + "entity_not_active", + "group_locked", + "insufficient_funds", + "cvv2_mismatch", + "transaction_not_allowed", + "breaches_limit", + "webhook_declined", + "webhook_timed_out", + "declined_by_stand_in_processing", + "invalid_physical_card", + "missing_original_authorization" + ], + "type": "string", + "x-enum-descriptions": [ + "The Card was not active.", + "The account's entity was not active.", + "The account was inactive.", + "The Card's Account did not have a sufficient available balance.", + "The given CVV2 did not match the card's value.", + "The attempted card transaction is not allowed per Increase's terms.", + "The transaction was blocked by a Limit.", + "Your application declined the transaction via webhook.", + "Your application webhook did not respond without the required timeout.", + "Declined by stand-in processing.", + "The card read had an invalid CVV, dCVV, or authorization request cryptogram.", + "The original card authorization for this incremental authorization does not exist." + ] + } + }, + "required": [ + "merchant_acceptor_id", + "merchant_descriptor", + "merchant_category_code", + "merchant_city", + "merchant_country", + "network", + "network_details", + "amount", + "currency", + "reason", + "merchant_state", + "real_time_decision_id", + "digital_wallet_token_id" + ], + "title": "Card Decline", + "type": "object", + "x-title-plural": "Card Declines" + }, + "card_route_decline": { + "description": "A Deprecated Card Decline object. This field will be present in the JSON response if and only if `category` is equal to `card_route_decline`.", + "example": { + "amount": -1000, + "currency": "USD", + "merchant_acceptor_id": "372909060886", + "merchant_category_code": "5998", + "merchant_city": "5364086000", + "merchant_country": "USA", + "merchant_descriptor": "TENTS R US", + "merchant_state": "CA" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "currency": { + "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination account currency.", + "enum": [ + "CAD", + "CHF", + "EUR", + "GBP", + "JPY", + "USD" + ], + "type": "string", + "x-enum-descriptions": [ + "Canadian Dollar (CAD)", + "Swiss Franc (CHF)", + "Euro (EUR)", + "British Pound (GBP)", + "Japanese Yen (JPY)", + "US Dollar (USD)" + ] + }, + "merchant_acceptor_id": { + "type": "string" + }, + "merchant_category_code": { + "nullable": true, + "type": "string" + }, + "merchant_city": { + "nullable": true, + "type": "string" + }, + "merchant_country": { + "type": "string" + }, + "merchant_descriptor": { + "type": "string" + }, + "merchant_state": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "amount", + "currency", + "merchant_acceptor_id", + "merchant_city", + "merchant_country", + "merchant_descriptor", + "merchant_state", + "merchant_category_code" + ], + "title": "Deprecated Card Decline", + "type": "object", + "x-title-plural": "Deprecated Card Declines" + }, + "category": { + "description": "The type of decline that took place. We may add additional possible values for this enum over time; your application should be able to handle such additions gracefully.", + "enum": [ + "ach_decline", + "card_decline", + "check_decline", + "inbound_real_time_payments_transfer_decline", + "international_ach_decline", + "card_route_decline", + "other" + ], + "type": "string", + "x-enum-descriptions": [ + "The Declined Transaction was created by a ACH Decline object. Details will be under the `ach_decline` object.", + "The Declined Transaction was created by a Card Decline object. Details will be under the `card_decline` object.", + "The Declined Transaction was created by a Check Decline object. Details will be under the `check_decline` object.", + "The Declined Transaction was created by a Inbound Real Time Payments Transfer Decline object. Details will be under the `inbound_real_time_payments_transfer_decline` object.", + "The Declined Transaction was created by a International ACH Decline object. Details will be under the `international_ach_decline` object.", + "The Declined Transaction was created by a Deprecated Card Decline object. Details will be under the `card_route_decline` object.", + "The Declined Transaction was made for an undocumented or deprecated reason." + ] + }, + "check_decline": { + "description": "A Check Decline object. This field will be present in the JSON response if and only if `category` is equal to `check_decline`.", + "example": { + "amount": -1000, + "auxiliary_on_us": "99999", + "reason": "insufficient_funds" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "auxiliary_on_us": { + "nullable": true, + "type": "string" + }, + "reason": { + "description": "Why the check was declined.", + "enum": [ + "ach_route_canceled", + "ach_route_disabled", + "breaches_limit", + "entity_not_active", + "group_locked", + "insufficient_funds", + "unable_to_locate_account", + "unable_to_process", + "refer_to_image", + "stop_payment_requested", + "returned", + "duplicate_presentment", + "not_authorized" + ], + "type": "string", + "x-enum-descriptions": [ + "The account number is canceled.", + "The account number is disabled.", + "The transaction would cause a limit to be exceeded.", + "The account's entity is not active.", + "Your account is inactive.", + "Your account contains insufficient funds.", + "Unable to locate account.", + "Unable to process.", + "Refer to image.", + "Stop payment requested for this check.", + "Check was returned to sender.", + "The check was a duplicate deposit.", + "The transaction is not allowed." + ] + } + }, + "required": [ + "amount", + "auxiliary_on_us", + "reason" + ], + "title": "Check Decline", + "type": "object", + "x-title-plural": "Check Declines" + }, + "inbound_real_time_payments_transfer_decline": { + "description": "A Inbound Real Time Payments Transfer Decline object. This field will be present in the JSON response if and only if `category` is equal to `inbound_real_time_payments_transfer_decline`.", + "example": { + "amount": 100, + "creditor_name": "Ian Crease", + "currency": "USD", + "debtor_account_number": "987654321", + "debtor_name": "National Phonograph Company", + "debtor_routing_number": "101050001", + "reason": "account_number_disabled", + "remittance_information": "Invoice 29582", + "transaction_identification": "20220501234567891T1BSLZO01745013025" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "creditor_name": { + "description": "The name the sender of the transfer specified as the recipient of the transfer.", + "type": "string" + }, + "currency": { + "description": "The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the declined transfer's currency. This will always be \"USD\" for a Real Time Payments transfer.", + "enum": [ + "CAD", + "CHF", + "EUR", + "GBP", + "JPY", + "USD" + ], + "type": "string", + "x-enum-descriptions": [ + "Canadian Dollar (CAD)", + "Swiss Franc (CHF)", + "Euro (EUR)", + "British Pound (GBP)", + "Japanese Yen (JPY)", + "US Dollar (USD)" + ] + }, + "debtor_account_number": { + "description": "The account number of the account that sent the transfer.", + "type": "string" + }, + "debtor_name": { + "description": "The name provided by the sender of the transfer.", + "type": "string" + }, + "debtor_routing_number": { + "description": "The routing number of the account that sent the transfer.", + "type": "string" + }, + "reason": { + "description": "Why the transfer was declined.", + "enum": [ + "account_number_canceled", + "account_number_disabled", + "group_locked", + "entity_not_active", + "real_time_payments_not_enabled" + ], + "type": "string", + "x-enum-descriptions": [ + "The account number is canceled.", + "The account number is disabled.", + "Your account is inactive.", + "The account's entity is not active.", + "Your account is not enabled to receive Real Time Payments transfers." + ] + }, + "remittance_information": { + "description": "Additional information included with the transfer.", + "nullable": true, + "type": "string" + }, + "transaction_identification": { + "description": "The Real Time Payments network identification of the declined transfer.", + "type": "string" + } + }, + "required": [ + "amount", + "currency", + "reason", + "creditor_name", + "debtor_name", + "debtor_account_number", + "debtor_routing_number", + "transaction_identification", + "remittance_information" + ], + "title": "Inbound Real Time Payments Transfer Decline", + "type": "object", + "x-title-plural": "Inbound Real Time Payments Transfer Declines" + }, + "international_ach_decline": { + "description": "A International ACH Decline object. This field will be present in the JSON response if and only if `category` is equal to `international_ach_decline`.", + "example": { + "amount": -1000, + "destination_country_code": "US", + "destination_currency_code": "USD", + "foreign_exchange_indicator": "fixed_to_fixed", + "foreign_exchange_reference": null, + "foreign_exchange_reference_indicator": "blank", + "foreign_payment_amount": 199, + "foreign_trace_number": null, + "international_transaction_type_code": "internet_initiated", + "originating_currency_code": "USD", + "originating_depository_financial_institution_branch_country": "US", + "originating_depository_financial_institution_id": "091000019", + "originating_depository_financial_institution_id_qualifier": "national_clearing_system_number", + "originating_depository_financial_institution_name": "WELLS FARGO BANK", + "originator_city": "BERLIN", + "originator_company_entry_description": "RETRY PYMT", + "originator_country": "DE", + "originator_identification": "770510487A", + "originator_name": "BERGHAIN", + "originator_postal_code": "50825", + "originator_state_or_province": null, + "originator_street_address": "Ruedersdorferstr. 7", + "payment_related_information": null, + "payment_related_information2": null, + "receiver_city": "BEVERLY HILLS", + "receiver_country": "US", + "receiver_identification_number": "1018790279274", + "receiver_postal_code": "90210", + "receiver_state_or_province": "CA", + "receiver_street_address": "123 FAKE ST", + "receiving_company_or_individual_name": "IAN CREASE", + "receiving_depository_financial_institution_country": "US", + "receiving_depository_financial_institution_id": "101050001", + "receiving_depository_financial_institution_id_qualifier": "national_clearing_system_number", + "receiving_depository_financial_institution_name": "BLUE RIDGE BANK, NATIONAL ASSOCIATI", + "trace_number": "010202909100090" + }, + "nullable": true, + "properties": { + "amount": { + "description": "The declined amount in the minor unit of the destination account currency. For dollars, for example, this is cents.", + "type": "integer" + }, + "destination_country_code": { + "type": "string" + }, + "destination_currency_code": { + "type": "string" + }, + "foreign_exchange_indicator": { + "type": "string" + }, + "foreign_exchange_reference": { + "nullable": true, + "type": "string" + }, + "foreign_exchange_reference_indicator": { + "type": "string" + }, + "foreign_payment_amount": { + "type": "integer" + }, + "foreign_trace_number": { + "nullable": true, + "type": "string" + }, + "international_transaction_type_code": { + "type": "string" + }, + "originating_currency_code": { + "type": "string" + }, + "originating_depository_financial_institution_branch_country": { + "type": "string" + }, + "originating_depository_financial_institution_id": { + "type": "string" + }, + "originating_depository_financial_institution_id_qualifier": { + "type": "string" + }, + "originating_depository_financial_institution_name": { + "type": "string" + }, + "originator_city": { + "type": "string" + }, + "originator_company_entry_description": { + "type": "string" + }, + "originator_country": { + "type": "string" + }, + "originator_identification": { + "type": "string" + }, + "originator_name": { + "type": "string" + }, + "originator_postal_code": { + "nullable": true, + "type": "string" + }, + "originator_state_or_province": { + "nullable": true, + "type": "string" + }, + "originator_street_address": { + "type": "string" + }, + "payment_related_information": { + "nullable": true, + "type": "string" + }, + "payment_related_information2": { + "nullable": true, + "type": "string" + }, + "receiver_city": { + "type": "string" + }, + "receiver_country": { + "type": "string" + }, + "receiver_identification_number": { + "nullable": true, + "type": "string" + }, + "receiver_postal_code": { + "nullable": true, + "type": "string" + }, + "receiver_state_or_province": { + "nullable": true, + "type": "string" + }, + "receiver_street_address": { + "type": "string" + }, + "receiving_company_or_individual_name": { + "type": "string" + }, + "receiving_depository_financial_institution_country": { + "type": "string" + }, + "receiving_depository_financial_institution_id": { + "type": "string" + }, + "receiving_depository_financial_institution_id_qualifier": { + "type": "string" + }, + "receiving_depository_financial_institution_name": { + "type": "string" + }, + "trace_number": { + "type": "string" + } + }, + "required": [ + "amount", + "foreign_exchange_indicator", + "foreign_exchange_reference_indicator", + "foreign_exchange_reference", + "destination_country_code", + "destination_currency_code", + "foreign_payment_amount", + "foreign_trace_number", + "international_transaction_type_code", + "originating_currency_code", + "originating_depository_financial_institution_name", + "originating_depository_financial_institution_id_qualifier", + "originating_depository_financial_institution_id", + "originating_depository_financial_institution_branch_country", + "originator_city", + "originator_company_entry_description", + "originator_country", + "originator_identification", + "originator_name", + "originator_postal_code", + "originator_street_address", + "originator_state_or_province", + "payment_related_information", + "payment_related_information2", + "receiver_identification_number", + "receiver_street_address", + "receiver_city", + "receiver_state_or_province", + "receiver_country", + "receiver_postal_code", + "receiving_company_or_individual_name", + "receiving_depository_financial_institution_name", + "receiving_depository_financial_institution_id_qualifier", + "receiving_depository_financial_institution_id", + "receiving_depository_financial_institution_country", + "trace_number" + ], + "title": "International ACH Decline", + "type": "object", + "x-title-plural": "International ACH Declines" + } + }, + "required": [ + "category", + "ach_decline", + "card_decline", + "check_decline", + "inbound_real_time_payments_transfer_decline", + "international_ach_decline", + "card_route_decline" + ], + "title": "Declined Transaction Source", + "type": "object", + "x-title-plural": "Declined Transaction Sources" + } + +Value: + { + "ach_decline": { + "amount": 1750, + "originator_company_descriptive_date": null, + "originator_company_discretionary_data": null, + "originator_company_id": "0987654321", + "originator_company_name": "BIG BANK", + "reason": "insufficient_funds", + "receiver_id_number": "12345678900", + "receiver_name": "IAN CREASE", + "trace_number": "021000038461022" + }, + "category": "ach_decline" + } diff --git a/openapi3/testdata/apis_guru_openapi_directory/intellifi_nl_2_23_4+0_gb463b49_dirty_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/intellifi_nl_2_23_4+0_gb463b49_dirty_openapi_yaml__validate index dde0141ec..8bdeed071 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/intellifi_nl_2_23_4+0_gb463b49_dirty_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/intellifi_nl_2_23_4+0_gb463b49_dirty_openapi_yaml__validate @@ -1,12 +1 @@ -invalid components: schema "Blob": invalid example: unhandled value of type time.Time -Schema: - { - "description": "[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) formatted string for when this resource was created.", - "example": "2018-08-30T09:51:59.737Z", - "format": "dateTime", - "readOnly": true, - "type": "string" - } - -Value: - "2018-08-30T09:51:59.737Z" +invalid components: schema "Item": invalid allOf element: invalid oneOf element: extra sibling fields: [description] diff --git a/openapi3/testdata/apis_guru_openapi_directory/lgtm_com_v1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/lgtm_com_v1_0_openapi_yaml__validate index b08e7c97d..3003bf1a9 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/lgtm_com_v1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/lgtm_com_v1_0_openapi_yaml__validate @@ -1,20 +1,172 @@ -invalid components: schema "analysis": invalid example: Error at "/analysis-date": unhandled value of type time.Time +invalid components: schema "operation": invalid example: Error at "/task-result": doesn't match schema due to: value must be an object Schema: { - "description": "The time the commit was analyzed.", - "format": "date-time", - "type": "string" + "example": { + "commit-id": "04d7a2300feec9bbcc48185e370e3b5d3ae4da9d", + "id": "2e65208b2f1872634132566a1a0ce6392407297c", + "languages": [ + { + "alerts": 628, + "analysis-date": "2000-01-23T04:56:07.000+00:00", + "commit-date": "2000-01-23T04:56:07.000+00:00", + "commit-id": "04d7a2300feec9bbcc48185e370e3b5d3ae4da9d", + "language": "javascript", + "lines": 133298, + "status": "success" + }, + { + "alerts": 628, + "analysis-date": "2000-01-23T04:56:07.000+00:00", + "commit-date": "2000-01-23T04:56:07.000+00:00", + "commit-id": "04d7a2300feec9bbcc48185e370e3b5d3ae4da9d", + "language": "javascript", + "lines": 133298, + "status": "success" + } + ], + "log-url": "https://lgtm.example.com/projects/g/yarnpkg/yarn/logs/analysis/2e65208b2f1872634132566a1a0ce6392407297c", + "project": { + "id": 1234567, + "name": "Apache Commons IO", + "url": "https://lgtm.example.com/projects/g/apache/commons-io", + "url-identifier": "g/apache/commons-io" + }, + "results-url": "https://lgtm.example.com/projects/g/yarnpkg/yarn/analysis/2e65208b2f1872634132566a1a0ce6392407297c/files" + }, + "properties": { + "commit-id": { + "description": "The commit identifier.\nThe commit identifier is included only if the same commit was successfully analyzed for all languages. A detailed breakdown of which commit was analyzed for each language is provided in the `languages` property.\n", + "example": "04d7a2300feec9bbcc48185e370e3b5d3ae4da9d", + "type": "string" + }, + "id": { + "description": "The analysis identifier.", + "example": "2e65208b2f1872634132566a1a0ce6392407297c", + "type": "string" + }, + "languages": { + "description": "Per-language information.", + "items": { + "$ref": "#/components/schemas/language-stats" + }, + "type": "array" + }, + "log-url": { + "description": "A page on LGTM to view the logs for this analysis.", + "example": "https://lgtm.example.com/projects/g/yarnpkg/yarn/logs/analysis/2e65208b2f1872634132566a1a0ce6392407297c", + "type": "string" + }, + "project": { + "$ref": "#/components/schemas/project" + }, + "results-url": { + "description": "A page on LGTM to view the results of this analysis.", + "example": "https://lgtm.example.com/projects/g/yarnpkg/yarn/analysis/2e65208b2f1872634132566a1a0ce6392407297c/files", + "type": "string" + } + }, + "type": "object" } Value: - "2000-01-23T04:56:07Z" - | Error at "/commit-date": unhandled value of type time.Time + "" + Or value must be an object Schema: { - "description": "The time of the commit.", - "format": "date-time", - "type": "string" + "example": { + "id": "b45e291e7033460949ec986153c5416d22157d3e", + "languages": [ + { + "alerts": [ + { + "fixed": 1, + "new": 0, + "query": { + "name": "Incomplete string escaping or encoding" + } + } + ], + "fixed": 1, + "language": "javascript", + "new": 0, + "status": "success", + "status-message": "1 fixed alert" + } + ], + "results-url": "https://lgtm.example.com/projects/g/yarnpkg/yarn/rev/pr-b45e291e7033460949ec986153c5416d22157d3e", + "status": "success", + "status-message": "Analysis succeeded" + }, + "properties": { + "id": { + "description": "The identifier for the review.", + "example": "b45e291e7033460949ec986153c5416d22157d3e", + "type": "string" + }, + "languages": { + "description": "Detailed information for each language analyzed.", + "items": { + "$ref": "#/components/schemas/codereview_languages" + }, + "type": "array" + }, + "results-url": { + "description": "A page on LGTM to view the status and results of this code review.", + "example": "https://lgtm.example.com/projects/g/yarnpkg/yarn/rev/pr-b45e291e7033460949ec986153c5416d22157d3e", + "type": "string" + }, + "status": { + "description": "The status of the code review.", + "enum": [ + "pending", + "failure", + "success" + ], + "example": "success", + "type": "string" + }, + "status-message": { + "description": "A summary of the current status of the code review.", + "example": "Analysis succeeded", + "type": "string" + } + }, + "type": "object" } Value: - "2000-01-23T04:56:07Z" + "" + Or value must be an object +Schema: + { + "example": { + "id": "b45e291e7033460949ec986153c5416d22157d3e", + "result-url": "https://lgtm.com/api/v1.0/query/b45e291e7033460949ec986153c5416d22157d3e", + "stats": { + "failed": 1, + "pending": 1, + "success-with-result": 3, + "success-without-result": 5, + "successful": 8 + } + }, + "properties": { + "id": { + "description": "The identifier for the QueryJob.", + "example": "b45e291e7033460949ec986153c5416d22157d3e", + "type": "string" + }, + "result-url": { + "description": "URL to view the result of the query job.", + "example": "https://lgtm.com/api/v1.0/query/b45e291e7033460949ec986153c5416d22157d3e", + "type": "string" + }, + "stats": { + "$ref": "#/components/schemas/queryjob_stats" + } + }, + "type": "object" + } + +Value: + "" diff --git a/openapi3/testdata/apis_guru_openapi_directory/mailchimp_com_3_0_55_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/mailchimp_com_3_0_55_openapi_yaml__validate index cc1bb4f1f..584178924 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/mailchimp_com_3_0_55_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/mailchimp_com_3_0_55_openapi_yaml__validate @@ -1,13 +1,22 @@ -invalid paths: invalid path /: invalid operation GET: invalid example: unhandled value of type time.Time +invalid paths: invalid path /account-exports: invalid operation POST: invalid example: value must be an array Schema: { - "description": "Date of first payment for monthly plans.", - "example": "2010-01-01T23:59:59Z", - "format": "date-time", - "readOnly": true, - "title": "First Payment", - "type": "string" + "description": "The stages of an account export to include.", + "example": "[\"audiences\", \"gallery_files\"]", + "items": { + "enum": [ + "audiences", + "campaigns", + "events", + "gallery_files", + "reports", + "templates" + ], + "type": "string" + }, + "title": "Include Stages", + "type": "array" } Value: - "2010-01-01T23:59:59Z" + "[\"audiences\", \"gallery_files\"]" diff --git a/openapi3/testdata/apis_guru_openapi_directory/medium_com_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/medium_com_1_0_openapi_yaml__validate index 51b5c40fd..4b3b11f4d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/medium_com_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/medium_com_1_0_openapi_yaml__validate @@ -1,9 +1 @@ -invalid paths: invalid path /article/{article_id}: invalid operation GET: invalid example: unhandled value of type time.Time -Schema: - { - "example": "2021-05-28T04:22:48Z", - "type": "string" - } - -Value: - "2021-05-28T04:22:48Z" +invalid paths: operation GET /search/articles?query={query} must define exactly all path parameters (missing: [query]) diff --git a/openapi3/testdata/apis_guru_openapi_directory/meraki_com_0_0_0_streaming_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/meraki_com_0_0_0_streaming_openapi_yaml__validate index bb53a2f81..69593e27b 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/meraki_com_0_0_0_streaming_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/meraki_com_0_0_0_streaming_openapi_yaml__validate @@ -1,10 +1,30 @@ -invalid paths: invalid path /networks/{networkId}/cameras/{serial}/snapshot: invalid operation POST: invalid example: Error at "/timestamp": unhandled value of type time.Time +invalid paths: invalid path /networks/{networkId}/clients/{clientId}/policy: invalid operation PUT: invalid example: Error at "/devicePolicy": property "devicePolicy" is missing Schema: { - "description": "[optional] The snapshot will be taken from this time on the camera. The timestamp is expected to be in ISO 8601 format. If no timestamp is specified, we will assume current time.", - "format": "date-time", - "type": "string" + "example": { + "groupPolicyId": "101", + "mac": "00:11:22:33:44:55", + "type": "Group policy" + }, + "properties": { + "devicePolicy": { + "description": "The policy to assign. Can be 'Whitelisted', 'Blocked', 'Normal' or 'Group policy'. Required.", + "type": "string" + }, + "groupPolicyId": { + "description": "[optional] If 'devicePolicy' is set to 'Group policy' this param is used to specify the group policy ID.", + "type": "string" + } + }, + "required": [ + "devicePolicy" + ], + "type": "object" } Value: - "2021-04-30T15:18:08Z" + { + "groupPolicyId": "101", + "mac": "00:11:22:33:44:55", + "type": "Group policy" + } diff --git a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_3_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_3_0_openapi_yaml__validate index b6e27ae1f..4e74a92fc 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_3_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_3_0_openapi_yaml__validate @@ -1,11 +1 @@ -invalid paths: invalid path /{projectId}/classify/iterations/{publishedName}/image: invalid operation POST: invalid example: example Successful ClassifyImage request: Error at "/created": unhandled value of type time.Time -Schema: - { - "description": "Date this prediction was created.", - "format": "date-time", - "readOnly": true, - "type": "string" - } - -Value: - "2019-03-06T02:15:00Z" +invalid paths: invalid path /{projectId}/detect/iterations/{publishedName}/image: invalid operation POST: invalid example: example Successful DetectImage request: Error at "/id": string doesn't match the format "uuid": string doesn't match pattern "^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$" | Error at "/project": string doesn't match the format "uuid": string doesn't match pattern "^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_0_openapi_yaml__validate index 82ba4d169..6711c89f6 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_0_openapi_yaml__validate @@ -1,22 +1,9 @@ -invalid paths: invalid path /projects: invalid operation GET: invalid example: example Successful GetProjects request: Error at "/0/created": unhandled value of type time.Time +invalid paths: invalid path /projects/{projectId}/images/tagged/count: invalid operation GET: invalid example: example Successful GetTaggedImageCount request: value must be an integer Schema: { - "description": "Gets the date this project was created", - "format": "date-time", - "readOnly": true, - "type": "string" + "format": "int32", + "type": "integer" } Value: - "2017-12-18T05:43:18.08Z" - | Error at "/0/lastModified": unhandled value of type time.Time -Schema: - { - "description": "Gets the date this project was last modified", - "format": "date-time", - "readOnly": true, - "type": "string" - } - -Value: - "2017-12-18T05:43:18.0962423Z" + "10" diff --git a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_1_openapi_yaml__validate index 82ba4d169..6711c89f6 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_1_openapi_yaml__validate @@ -1,22 +1,9 @@ -invalid paths: invalid path /projects: invalid operation GET: invalid example: example Successful GetProjects request: Error at "/0/created": unhandled value of type time.Time +invalid paths: invalid path /projects/{projectId}/images/tagged/count: invalid operation GET: invalid example: example Successful GetTaggedImageCount request: value must be an integer Schema: { - "description": "Gets the date this project was created", - "format": "date-time", - "readOnly": true, - "type": "string" + "format": "int32", + "type": "integer" } Value: - "2017-12-18T05:43:18.08Z" - | Error at "/0/lastModified": unhandled value of type time.Time -Schema: - { - "description": "Gets the date this project was last modified", - "format": "date-time", - "readOnly": true, - "type": "string" - } - -Value: - "2017-12-18T05:43:18.0962423Z" + "10" diff --git a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_2_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_2_openapi_yaml__validate index d3ca13ce6..6711c89f6 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_2_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_2_2_openapi_yaml__validate @@ -1,22 +1,9 @@ -invalid paths: invalid path /projects: invalid operation GET: invalid example: example Successful GetProjects request: Error at "/0/created": unhandled value of type time.Time +invalid paths: invalid path /projects/{projectId}/images/tagged/count: invalid operation GET: invalid example: example Successful GetTaggedImageCount request: value must be an integer Schema: { - "description": "Gets the date this project was created.", - "format": "date-time", - "readOnly": true, - "type": "string" + "format": "int32", + "type": "integer" } Value: - "2017-12-18T05:43:18.08Z" - | Error at "/0/lastModified": unhandled value of type time.Time -Schema: - { - "description": "Gets the date this project was last modified.", - "format": "date-time", - "readOnly": true, - "type": "string" - } - -Value: - "2017-12-18T05:43:18.0962423Z" + "10" diff --git a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_0_openapi_yaml__validate index c827cce4b..336b8c100 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_0_openapi_yaml__validate @@ -1,22 +1 @@ -invalid paths: invalid path /projects: invalid operation GET: invalid example: example Successful GetProjects request: Error at "/0/created": unhandled value of type time.Time -Schema: - { - "description": "Gets the date this project was created.", - "format": "date-time", - "readOnly": true, - "type": "string" - } - -Value: - "2017-12-18T05:43:18Z" - | Error at "/0/lastModified": unhandled value of type time.Time -Schema: - { - "description": "Gets the date this project was last modified.", - "format": "date-time", - "readOnly": true, - "type": "string" - } - -Value: - "2017-12-18T05:43:18Z" +invalid paths: invalid path /projects/{projectId}/images/regions: invalid operation DELETE: invalid example: Successful DeleteImageRegions request: Error at "/0": string doesn't match the format "uuid": string doesn't match pattern "^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_1_openapi_yaml__validate index c827cce4b..336b8c100 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_1_openapi_yaml__validate @@ -1,22 +1 @@ -invalid paths: invalid path /projects: invalid operation GET: invalid example: example Successful GetProjects request: Error at "/0/created": unhandled value of type time.Time -Schema: - { - "description": "Gets the date this project was created.", - "format": "date-time", - "readOnly": true, - "type": "string" - } - -Value: - "2017-12-18T05:43:18Z" - | Error at "/0/lastModified": unhandled value of type time.Time -Schema: - { - "description": "Gets the date this project was last modified.", - "format": "date-time", - "readOnly": true, - "type": "string" - } - -Value: - "2017-12-18T05:43:18Z" +invalid paths: invalid path /projects/{projectId}/images/regions: invalid operation DELETE: invalid example: Successful DeleteImageRegions request: Error at "/0": string doesn't match the format "uuid": string doesn't match pattern "^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_2_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_2_openapi_yaml__validate index c827cce4b..336b8c100 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_2_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_3_2_openapi_yaml__validate @@ -1,22 +1 @@ -invalid paths: invalid path /projects: invalid operation GET: invalid example: example Successful GetProjects request: Error at "/0/created": unhandled value of type time.Time -Schema: - { - "description": "Gets the date this project was created.", - "format": "date-time", - "readOnly": true, - "type": "string" - } - -Value: - "2017-12-18T05:43:18Z" - | Error at "/0/lastModified": unhandled value of type time.Time -Schema: - { - "description": "Gets the date this project was last modified.", - "format": "date-time", - "readOnly": true, - "type": "string" - } - -Value: - "2017-12-18T05:43:18Z" +invalid paths: invalid path /projects/{projectId}/images/regions: invalid operation DELETE: invalid example: Successful DeleteImageRegions request: Error at "/0": string doesn't match the format "uuid": string doesn't match pattern "^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversation_2_0_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversation_2_0_1_openapi_yaml__validate index b05119197..f1ea5e49d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversation_2_0_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversation_2_0_1_openapi_yaml__validate @@ -1,10 +1,10 @@ -invalid components: schema "event_retrieved": invalid example: unhandled value of type time.Time +invalid paths: invalid path /conversations: invalid operation GET: invalid example: value must be a number Schema: { - "description": "Time of creation", - "example": "2020-01-01T14:00:00Z", - "type": "string" + "description": "The total number of records returned by your request.", + "example": "100", + "type": "number" } Value: - "2020-01-01T14:00:00Z" + "100" diff --git a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversation_v2_1_0_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversation_v2_1_0_1_openapi_yaml__validate index 61c2e6135..a393008ff 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversation_v2_1_0_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversation_v2_1_0_1_openapi_yaml__validate @@ -1,10 +1,8 @@ -invalid components: schema "all_events": invalid anyOf element: invalid allOf element: invalid example: unhandled value of type time.Time +invalid components: parameter "end_id_parameter": invalid example: value must be a string Schema: { - "description": "The time that the event happened", - "example": "2019-09-12T19:49:21.823Z", "type": "string" } Value: - "2019-09-12T19:49:21.823Z" + 19 diff --git a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_dispatch_0_3_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_dispatch_0_3_4_openapi_yaml__validate index d3b294fb6..89d653ec6 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_dispatch_0_3_4_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_dispatch_0_3_4_openapi_yaml__validate @@ -1,11 +1,16 @@ -invalid components: schema "MessageStatus": invalid example: unhandled value of type time.Time +invalid components: schema "finalReport": invalid example: value is not one of the allowed values ["messenger","viber_sevice_msg","sms","whatsapp","mms"] Schema: { - "description": "The datetime of when the event occurred.", - "example": "2020-01-01T14:00:00Z", - "format": "ISO 8601", + "enum": [ + "messenger", + "viber_sevice_msg", + "sms", + "whatsapp", + "mms" + ], + "example": "viber_service_msg", "type": "string" } Value: - "2020-01-01T14:00:00Z" + "viber_service_msg" diff --git a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_messages_olympus_1_4_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_messages_olympus_1_4_0_openapi_yaml__validate index 6ccf0ff9f..a448898c1 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_messages_olympus_1_4_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_messages_olympus_1_4_0_openapi_yaml__validate @@ -1,10 +1,10 @@ -invalid components: schema "InboundMessengerMessageCommon": invalid example: unhandled value of type time.Time +invalid components: schema "messageStatusBase": invalid example: value must be a string Schema: { - "description": "The datetime of when the event occurred, in `ISO 8601` format.", - "example": "2020-01-01T14:00:00Z", + "description": "The error code encountered when sending the message. See [our errors list](https://developer.nexmo.com/api-errors/messages-olympus) for a list of possible errors", + "example": 1000, "type": "string" } Value: - "2020-01-01T14:00:00Z" + 1000 diff --git a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_reports_2_2_2_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_reports_2_2_2_openapi_yaml__validate index 5133f6c22..7f0e5d68d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_reports_2_2_2_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_reports_2_2_2_openapi_yaml__validate @@ -1,11 +1 @@ -invalid components: schema "ASR": invalid allOf element: invalid example: unhandled value of type time.Time -Schema: - { - "description": "ISO-8601 extended time zone offset or ISO-8601 UTC zone offset formatted date (format `yyyy-mm-ddThh:mm:ss[.sss]±hh:mm` or `yyyy-mm-ddThh:mm:ss[.sss]Z`) for when report should end. It is exclusive, i.e. the provided value is strictly greater than the value in the field `date_received` in the CDR. \u003cbr\u003eIf unspecified, defaults to the current time.\n", - "example": "2018-01-01T00:00:00Z", - "format": "date", - "type": "string" - } - -Value: - "2018-01-01T00:00:00Z" +invalid components: schema "ASR": invalid allOf element: invalid example: string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_subaccounts_1_0_8_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_subaccounts_1_0_8_openapi_yaml__validate index 12ff39773..05421f91b 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_subaccounts_1_0_8_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_subaccounts_1_0_8_openapi_yaml__validate @@ -1,10 +1,9 @@ -invalid components: schema "ListBalanceTransfersResponse": invalid example: unhandled value of type time.Time +invalid components: schema "TransferBalanceOrCreditRequest": invalid example: value must be a number Schema: { - "description": "The date and time when the balance transfer was executed", - "example": "2019-03-02T16:34:49Z", - "type": "string" + "example": "123.45", + "type": "number" } Value: - "2019-03-02T16:34:49Z" + "123.45" diff --git a/openapi3/testdata/apis_guru_openapi_directory/notion_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/notion_com_1_0_0_openapi_yaml__validate index 044e497a0..90e10a40b 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/notion_com_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/notion_com_1_0_0_openapi_yaml__validate @@ -1,9 +1 @@ -invalid paths: invalid path /v1/blocks/{id}: invalid operation DELETE: invalid example: unhandled value of type time.Time -Schema: - { - "example": "2021-08-06T17:46:00Z", - "type": "string" - } - -Value: - "2021-08-06T17:46:00Z" +invalid paths: invalid path /v1/pages/{id}: invalid operation GET: parameter name can't be blank diff --git a/openapi3/testdata/apis_guru_openapi_directory/openuv_io_v1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/openuv_io_v1_openapi_yaml__validate index e8b65aed5..af99cc291 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/openuv_io_v1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/openuv_io_v1_openapi_yaml__validate @@ -1,11 +1 @@ -invalid paths: invalid path /forecast: invalid operation GET: parameter "dt" schema is invalid: invalid example: unhandled value of type time.Time -Schema: - { - "description": "UTC datetime in ISO-8601 format, now by default. Use that parameter to get UV Index Forecast for any point in time.", - "example": "2018-02-04T04:39:06.467Z", - "format": "date-time", - "type": "string" - } - -Value: - "2018-02-04T04:39:06.467Z" +invalid paths: invalid path /protection: invalid operation GET: extra sibling fields: [type] diff --git a/openapi3/testdata/apis_guru_openapi_directory/pandascore_co_2_23_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/pandascore_co_2_23_1_openapi_yaml__validate index 2af8c6459..a3b23feea 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/pandascore_co_2_23_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/pandascore_co_2_23_1_openapi_yaml__validate @@ -1,14 +1,4 @@ -invalid components: response "AdditionIncidents": invalid example: example /additions?page[size]=1: Error at "/0": doesn't match schema due to: Error at "/modified_at": unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-22T23:45:50Z" - | Error at "/object": property "begin_at" is unsupported +invalid components: response "AdditionIncidents": invalid example: example /additions?page[size]=1: Error at "/0": doesn't match schema due to: Error at "/object": property "begin_at" is unsupported Schema: { "additionalProperties": false, @@ -3164,16 +3154,6 @@ Value: "winner": null, "winner_id": null } - | Error at "/object/modified_at": unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-22T23:45:50Z" | Error at "/object": property "number_of_games" is unsupported Schema: { @@ -9184,35 +9164,7 @@ Schema: Value: "match" - Or Error at "/modified_at": unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-22T23:45:50Z" - | Error at "/object/begin_at": doesn't match schema due to: unhandled value of type time.Time -Schema: - { - "nullable": true - } - -Value: - "2021-04-24T16:00:00Z" - And unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-24T16:00:00Z" - | Error at "/object/end_at": doesn't match schema due to: Value is not nullable + Or Error at "/object/end_at": doesn't match schema due to: Value is not nullable Schema: { "format": "date-time", @@ -9622,16 +9574,6 @@ Schema: Value: null - | Error at "/object/league/modified_at": unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-22T10:15:12Z" | Error at "/object/league/url": doesn't match schema due to: Value is not nullable Schema: { @@ -9660,70 +9602,6 @@ Schema: Value: null - | Error at "/object/modified_at": unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-22T23:45:50Z" - | Error at "/object/original_scheduled_at": doesn't match schema due to: unhandled value of type time.Time -Schema: - { - "nullable": true - } - -Value: - "2021-04-24T16:00:00Z" - And unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-24T16:00:00Z" - | Error at "/object/scheduled_at": doesn't match schema due to: unhandled value of type time.Time -Schema: - { - "nullable": true - } - -Value: - "2021-04-24T16:00:00Z" - And unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-24T16:00:00Z" - | Error at "/object/serie/begin_at": doesn't match schema due to: unhandled value of type time.Time -Schema: - { - "nullable": true - } - -Value: - "2021-04-12T10:00:00Z" - And unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-12T10:00:00Z" | Error at "/object/serie/description": doesn't match schema due to: Value is not nullable Schema: { @@ -9742,16 +9620,6 @@ Schema: Value: null - | Error at "/object/serie/modified_at": unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-12T07:20:33Z" | Error at "/object/serie/name": doesn't match schema due to: Value is not nullable Schema: { @@ -9795,52 +9663,6 @@ Schema: Value: null - | Error at "/object/tournament/begin_at": doesn't match schema due to: unhandled value of type time.Time -Schema: - { - "nullable": true - } - -Value: - "2021-04-19T10:00:00Z" - And unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-19T10:00:00Z" - | Error at "/object/tournament/end_at": doesn't match schema due to: unhandled value of type time.Time -Schema: - { - "nullable": true - } - -Value: - "2021-04-24T22:00:00Z" - And unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-24T22:00:00Z" - | Error at "/object/tournament/modified_at": unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-22T13:14:31Z" | Error at "/object/tournament/winner_id": doesn't match schema due to: doesn't match any schema from "anyOf" Schema: { @@ -10094,17 +9916,7 @@ Schema: Value: null - Or Error at "/modified_at": unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-22T23:45:50Z" - | Error at "/object": property "begin_at" is unsupported + Or Error at "/object": property "begin_at" is unsupported Schema: { "additionalProperties": false, @@ -23881,35 +23693,7 @@ Schema: Value: "match" - Or Error at "/modified_at": unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-22T23:45:50Z" - | Error at "/object/begin_at": doesn't match schema due to: unhandled value of type time.Time -Schema: - { - "nullable": true - } - -Value: - "2021-04-24T16:00:00Z" - And unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-24T16:00:00Z" - | Error at "/object": property "detailed_stats" is unsupported + Or Error at "/object": property "detailed_stats" is unsupported Schema: { "additionalProperties": false, @@ -25719,16 +25503,6 @@ Value: "winner": null, "winner_id": null } - | Error at "/object/league/modified_at": unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-22T10:15:12Z" | Error at "/object/league/url": doesn't match schema due to: Value is not nullable Schema: { @@ -26818,16 +26592,6 @@ Value: "winner": null, "winner_id": null } - | Error at "/object/modified_at": unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-22T23:45:50Z" | Error at "/object": property "number_of_games" is unsupported Schema: { @@ -35493,17 +35257,7 @@ Schema: Value: "match" - Or Error at "/modified_at": unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-22T23:45:50Z" - | Error at "/object": property "begin_at" is unsupported + Or Error at "/object": property "begin_at" is unsupported Schema: { "additionalProperties": false, @@ -38995,16 +38749,6 @@ Value: "winner": null, "winner_id": null } - | Error at "/object/modified_at": unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-22T23:45:50Z" | Error at "/object": property "number_of_games" is unsupported Schema: { @@ -45708,35 +45452,7 @@ Schema: Value: "match" - Or Error at "/modified_at": unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-22T23:45:50Z" - | Error at "/object/begin_at": doesn't match schema due to: unhandled value of type time.Time -Schema: - { - "nullable": true - } - -Value: - "2021-04-24T16:00:00Z" - And unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-24T16:00:00Z" - | Error at "/object": property "detailed_stats" is unsupported + Or Error at "/object": property "detailed_stats" is unsupported Schema: { "additionalProperties": false, @@ -47381,16 +47097,6 @@ Value: "winner": null, "winner_id": null } - | Error at "/object/league/modified_at": unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-22T10:15:12Z" | Error at "/object/league/url": doesn't match schema due to: Value is not nullable Schema: { @@ -48381,16 +48087,6 @@ Value: "winner": null, "winner_id": null } - | Error at "/object/modified_at": unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-22T23:45:50Z" | Error at "/object": property "number_of_games" is unsupported Schema: { @@ -50680,24 +50376,6 @@ Value: "winner": null, "winner_id": null } - | Error at "/object/serie/begin_at": doesn't match schema due to: unhandled value of type time.Time -Schema: - { - "nullable": true - } - -Value: - "2021-04-12T10:00:00Z" - And unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-12T10:00:00Z" | Error at "/object/serie/description": doesn't match schema due to: Value is not nullable Schema: { @@ -50716,16 +50394,6 @@ Schema: Value: null - | Error at "/object/serie/modified_at": unhandled value of type time.Time -Schema: - { - "format": "date-time", - "minLength": 1, - "type": "string" - } - -Value: - "2021-04-12T07:20:33Z" | Error at "/object/serie/name": doesn't match schema due to: Value is not nullable Schema: { diff --git a/openapi3/testdata/apis_guru_openapi_directory/pay1_de_link_v1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/pay1_de_link_v1_openapi_yaml__validate index 2b3b741e6..89e5fff52 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/pay1_de_link_v1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/pay1_de_link_v1_openapi_yaml__validate @@ -1,11 +1 @@ -invalid components: schema "CartItemDto": invalid example: unhandled value of type time.Time -Schema: - { - "description": "delivery period end date", - "example": "2021-01-01T00:00:00Z", - "format": "date", - "type": "string" - } - -Value: - "2021-01-01T00:00:00Z" +invalid components: security scheme "createAuth": security scheme of type 'http' has invalid 'scheme' value "payone-hmac-sha256" diff --git a/openapi3/testdata/apis_guru_openapi_directory/pdfgeneratorapi_com_3_1_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/pdfgeneratorapi_com_3_1_1_openapi_yaml__validate index 8554abe99..678cfcb2d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/pdfgeneratorapi_com_3_1_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/pdfgeneratorapi_com_3_1_1_openapi_yaml__validate @@ -1,10 +1,13 @@ -invalid components: schema "Template": invalid example: unhandled value of type time.Time +invalid components: response "error403": invalid example: value is not one of the allowed values ["Your account has exceeded the monthly document generation limit."] Schema: { - "description": "Timestamp when the template was modified", - "example": "2017-10-21T11:49:28Z", + "description": "Error description", + "enum": [ + "Your account has exceeded the monthly document generation limit." + ], + "example": "Access not granted", "type": "string" } Value: - "2017-10-21T11:49:28Z" + "Access not granted" diff --git a/openapi3/testdata/apis_guru_openapi_directory/personio_de_personnel_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/personio_de_personnel_1_0_openapi_yaml__validate index 7b6a8e3e5..63e5f7d6b 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/personio_de_personnel_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/personio_de_personnel_1_0_openapi_yaml__validate @@ -9,23 +9,3 @@ Value: { "$ref": "#/components/schemas/UpdateAttendancePeriodRequest/example/comment" } - | Error at "/attendances/0/date": unhandled value of type time.Time -Schema: - { - "description": "Attendance date as YYYY-MM-DD", - "format": "date", - "type": "string" - } - -Value: - "2017-01-18T00:00:00Z" - | Error at "/attendances/1/date": unhandled value of type time.Time -Schema: - { - "description": "Attendance date as YYYY-MM-DD", - "format": "date", - "type": "string" - } - -Value: - "2017-01-17T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/plaid_com_2020_09_14_1_345_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/plaid_com_2020_09_14_1_345_1_openapi_yaml__validate index 585168e23..e9ec8ef81 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/plaid_com_2020_09_14_1_345_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/plaid_com_2020_09_14_1_345_1_openapi_yaml__validate @@ -1,11 +1,314 @@ -invalid components: schema "Activity": invalid example: unhandled value of type time.Time +invalid paths: invalid path /asset_report/get: invalid operation POST: invalid example: example example-1: Error at "/report/items/0/accounts/0": doesn't match schema due to: Error at "/balances/limit": property "limit" is missing Schema: { - "description": "The date and time this activity was initiated [ISO 8601](https://wikipedia.org/wiki/ISO_8601) (YYYY-MM-DD) format in UTC.", - "example": "2020-01-01T00:00:00Z", - "format": "datetime", - "type": "string" + "additionalProperties": true, + "description": "A set of fields describing the balance for an account. Balance information may be cached unless the balance object was returned by `/accounts/balance/get`.", + "properties": { + "available": { + "description": "The amount of funds available to be withdrawn from the account, as determined by the financial institution.\n\nFor `credit`-type accounts, the `available` balance typically equals the `limit` less the `current` balance, less any pending outflows plus any pending inflows.\n\nFor `depository`-type accounts, the `available` balance typically equals the `current` balance less any pending outflows plus any pending inflows. For `depository`-type accounts, the `available` balance does not include the overdraft limit.\n\nFor `investment`-type accounts (or `brokerage`-type accounts for API versions 2018-05-22 and earlier), the `available` balance is the total cash available to withdraw as presented by the institution.\n\nNote that not all institutions calculate the `available` balance. In the event that `available` balance is unavailable, Plaid will return an `available` balance value of `null`.\n\nAvailable balance may be cached and is not guaranteed to be up-to-date in realtime unless the value was returned by `/accounts/balance/get`.\n\nIf `current` is `null` this field is guaranteed not to be `null`.", + "format": "double", + "nullable": true, + "type": "number" + }, + "current": { + "description": "The total amount of funds in or owed by the account.\n\nFor `credit`-type accounts, a positive balance indicates the amount owed; a negative amount indicates the lender owing the account holder.\n\nFor `loan`-type accounts, the current balance is the principal remaining on the loan, except in the case of student loan accounts at Sallie Mae (`ins_116944`). For Sallie Mae student loans, the account's balance includes both principal and any outstanding interest.\n\nFor `investment`-type accounts (or `brokerage`-type accounts for API versions 2018-05-22 and earlier), the current balance is the total value of assets as presented by the institution.\n\nNote that balance information may be cached unless the value was returned by `/accounts/balance/get`; if the Item is enabled for Transactions, the balance will be at least as recent as the most recent Transaction update. If you require realtime balance information, use the `available` balance as provided by `/accounts/balance/get`.\n\nWhen returned by `/accounts/balance/get`, this field may be `null`. When this happens, `available` is guaranteed not to be `null`.", + "format": "double", + "nullable": true, + "type": "number" + }, + "iso_currency_code": { + "description": "The ISO-4217 currency code of the balance. Always null if `unofficial_currency_code` is non-null.", + "nullable": true, + "type": "string" + }, + "last_updated_datetime": { + "description": "Timestamp in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:mm:ssZ`) indicating the last time that the balance for the given account has been updated\n\nThis is currently only provided when the `min_last_updated_datetime` is passed when calling `/accounts/balance/get` for `ins_128026` (Capital One).", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "limit": { + "description": "For `credit`-type accounts, this represents the credit limit.\n\nFor `depository`-type accounts, this represents the pre-arranged overdraft limit, which is common for current (checking) accounts in Europe.\n\nIn North America, this field is typically only available for `credit`-type accounts.", + "format": "double", + "nullable": true, + "type": "number" + }, + "unofficial_currency_code": { + "description": "The unofficial currency code associated with the balance. Always null if `iso_currency_code` is non-null. Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries.\n\nSee the [currency code schema](https://plaid.com/docs/api/accounts#currency-code-schema) for a full listing of supported `unofficial_currency_code`s.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "available", + "current", + "limit", + "iso_currency_code", + "unofficial_currency_code" + ], + "title": "AccountBalance", + "type": "object" } Value: - "2020-01-01T00:00:00Z" + { + "available": 43200, + "current": 43200, + "iso_currency_code": "USD", + "unofficial_currency_code": null + } + And Error at "/owners/0/addresses/0/data/country": property "country" is missing +Schema: + { + "additionalProperties": true, + "description": "Data about the components comprising an address.", + "properties": { + "city": { + "description": "The full city name", + "nullable": true, + "type": "string" + }, + "country": { + "description": "The ISO 3166-1 alpha-2 country code", + "nullable": true, + "type": "string" + }, + "postal_code": { + "description": "The postal code. In API versions 2018-05-22 and earlier, this field is called `zip`.", + "nullable": true, + "type": "string" + }, + "region": { + "description": "The region or state. In API versions 2018-05-22 and earlier, this field is called `state`.\nExample: `\"NC\"`", + "nullable": true, + "type": "string" + }, + "street": { + "description": "The full street address\nExample: `\"564 Main Street, APT 15\"`", + "type": "string" + } + }, + "required": [ + "city", + "region", + "street", + "postal_code", + "country" + ], + "title": "AddressData", + "type": "object" + } + +Value: + { + "city": "Malakoff", + "postal_code": "14236", + "region": "NY", + "street": "2992 Cameron Road" + } + | Error at "/owners/0/addresses/1/data/country": property "country" is missing +Schema: + { + "additionalProperties": true, + "description": "Data about the components comprising an address.", + "properties": { + "city": { + "description": "The full city name", + "nullable": true, + "type": "string" + }, + "country": { + "description": "The ISO 3166-1 alpha-2 country code", + "nullable": true, + "type": "string" + }, + "postal_code": { + "description": "The postal code. In API versions 2018-05-22 and earlier, this field is called `zip`.", + "nullable": true, + "type": "string" + }, + "region": { + "description": "The region or state. In API versions 2018-05-22 and earlier, this field is called `state`.\nExample: `\"NC\"`", + "nullable": true, + "type": "string" + }, + "street": { + "description": "The full street address\nExample: `\"564 Main Street, APT 15\"`", + "type": "string" + } + }, + "required": [ + "city", + "region", + "street", + "postal_code", + "country" + ], + "title": "AddressData", + "type": "object" + } + +Value: + { + "city": "San Matias", + "postal_code": "93405-2255", + "region": "CA", + "street": "2493 Leisure Lane" + } + | Error at "/report/items/0/accounts/1": doesn't match schema due to: Error at "/balances/limit": property "limit" is missing +Schema: + { + "additionalProperties": true, + "description": "A set of fields describing the balance for an account. Balance information may be cached unless the balance object was returned by `/accounts/balance/get`.", + "properties": { + "available": { + "description": "The amount of funds available to be withdrawn from the account, as determined by the financial institution.\n\nFor `credit`-type accounts, the `available` balance typically equals the `limit` less the `current` balance, less any pending outflows plus any pending inflows.\n\nFor `depository`-type accounts, the `available` balance typically equals the `current` balance less any pending outflows plus any pending inflows. For `depository`-type accounts, the `available` balance does not include the overdraft limit.\n\nFor `investment`-type accounts (or `brokerage`-type accounts for API versions 2018-05-22 and earlier), the `available` balance is the total cash available to withdraw as presented by the institution.\n\nNote that not all institutions calculate the `available` balance. In the event that `available` balance is unavailable, Plaid will return an `available` balance value of `null`.\n\nAvailable balance may be cached and is not guaranteed to be up-to-date in realtime unless the value was returned by `/accounts/balance/get`.\n\nIf `current` is `null` this field is guaranteed not to be `null`.", + "format": "double", + "nullable": true, + "type": "number" + }, + "current": { + "description": "The total amount of funds in or owed by the account.\n\nFor `credit`-type accounts, a positive balance indicates the amount owed; a negative amount indicates the lender owing the account holder.\n\nFor `loan`-type accounts, the current balance is the principal remaining on the loan, except in the case of student loan accounts at Sallie Mae (`ins_116944`). For Sallie Mae student loans, the account's balance includes both principal and any outstanding interest.\n\nFor `investment`-type accounts (or `brokerage`-type accounts for API versions 2018-05-22 and earlier), the current balance is the total value of assets as presented by the institution.\n\nNote that balance information may be cached unless the value was returned by `/accounts/balance/get`; if the Item is enabled for Transactions, the balance will be at least as recent as the most recent Transaction update. If you require realtime balance information, use the `available` balance as provided by `/accounts/balance/get`.\n\nWhen returned by `/accounts/balance/get`, this field may be `null`. When this happens, `available` is guaranteed not to be `null`.", + "format": "double", + "nullable": true, + "type": "number" + }, + "iso_currency_code": { + "description": "The ISO-4217 currency code of the balance. Always null if `unofficial_currency_code` is non-null.", + "nullable": true, + "type": "string" + }, + "last_updated_datetime": { + "description": "Timestamp in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:mm:ssZ`) indicating the last time that the balance for the given account has been updated\n\nThis is currently only provided when the `min_last_updated_datetime` is passed when calling `/accounts/balance/get` for `ins_128026` (Capital One).", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "limit": { + "description": "For `credit`-type accounts, this represents the credit limit.\n\nFor `depository`-type accounts, this represents the pre-arranged overdraft limit, which is common for current (checking) accounts in Europe.\n\nIn North America, this field is typically only available for `credit`-type accounts.", + "format": "double", + "nullable": true, + "type": "number" + }, + "unofficial_currency_code": { + "description": "The unofficial currency code associated with the balance. Always null if `iso_currency_code` is non-null. Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries.\n\nSee the [currency code schema](https://plaid.com/docs/api/accounts#currency-code-schema) for a full listing of supported `unofficial_currency_code`s.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "available", + "current", + "limit", + "iso_currency_code", + "unofficial_currency_code" + ], + "title": "AccountBalance", + "type": "object" + } + +Value: + { + "available": 100, + "current": 110, + "iso_currency_code": "USD", + "unofficial_currency_code": null + } + And Error at "/owners/0/addresses/0/data/country": property "country" is missing +Schema: + { + "additionalProperties": true, + "description": "Data about the components comprising an address.", + "properties": { + "city": { + "description": "The full city name", + "nullable": true, + "type": "string" + }, + "country": { + "description": "The ISO 3166-1 alpha-2 country code", + "nullable": true, + "type": "string" + }, + "postal_code": { + "description": "The postal code. In API versions 2018-05-22 and earlier, this field is called `zip`.", + "nullable": true, + "type": "string" + }, + "region": { + "description": "The region or state. In API versions 2018-05-22 and earlier, this field is called `state`.\nExample: `\"NC\"`", + "nullable": true, + "type": "string" + }, + "street": { + "description": "The full street address\nExample: `\"564 Main Street, APT 15\"`", + "type": "string" + } + }, + "required": [ + "city", + "region", + "street", + "postal_code", + "country" + ], + "title": "AddressData", + "type": "object" + } + +Value: + { + "city": "Malakoff", + "postal_code": "14236", + "region": "NY", + "street": "2992 Cameron Road" + } + | Error at "/owners/0/addresses/1/data/country": property "country" is missing +Schema: + { + "additionalProperties": true, + "description": "Data about the components comprising an address.", + "properties": { + "city": { + "description": "The full city name", + "nullable": true, + "type": "string" + }, + "country": { + "description": "The ISO 3166-1 alpha-2 country code", + "nullable": true, + "type": "string" + }, + "postal_code": { + "description": "The postal code. In API versions 2018-05-22 and earlier, this field is called `zip`.", + "nullable": true, + "type": "string" + }, + "region": { + "description": "The region or state. In API versions 2018-05-22 and earlier, this field is called `state`.\nExample: `\"NC\"`", + "nullable": true, + "type": "string" + }, + "street": { + "description": "The full street address\nExample: `\"564 Main Street, APT 15\"`", + "type": "string" + } + }, + "required": [ + "city", + "region", + "street", + "postal_code", + "country" + ], + "title": "AddressData", + "type": "object" + } + +Value: + { + "city": "San Matias", + "postal_code": "93405-2255", + "region": "CA", + "street": "2493 Leisure Lane" + } diff --git a/openapi3/testdata/apis_guru_openapi_directory/pocketsmith_com_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/pocketsmith_com_2_0_openapi_yaml__validate index 53a28d8b2..a930b8678 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/pocketsmith_com_2_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/pocketsmith_com_2_0_openapi_yaml__validate @@ -1,10 +1,8 @@ -invalid components: schema "Account": invalid example: unhandled value of type time.Time +invalid paths: invalid path /users/{id}/trend_analysis: invalid operation GET: invalid example: value must be an integer Schema: { - "description": "When the account was created.", - "example": "2018-02-27T00:00:00Z", - "type": "string" + "type": "integer" } Value: - "2018-02-27T00:00:00Z" + true diff --git a/openapi3/testdata/apis_guru_openapi_directory/pressassociation_io_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/pressassociation_io_2_0_openapi_yaml__validate index 6fc4bdd6c..e1c4a8499 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/pressassociation_io_2_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/pressassociation_io_2_0_openapi_yaml__validate @@ -1,10 +1,10 @@ -invalid paths: invalid path /asset: invalid operation GET: parameter "updatedAfter" schema is invalid: invalid default: unhandled value of type time.Time +invalid paths: invalid path /asset: invalid operation GET: parameter "updatedAfter" schema is invalid: invalid default: string doesn't match the regular expression "date-time" Schema: { - "default": "2015-05-05T00:00:00Z", + "default": "2015-05-05T00:00:00.000Z", "pattern": "date-time", "type": "string" } Value: - "2015-05-05T00:00:00Z" + "2015-05-05T00:00:00.000Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/probely_com_1_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/probely_com_1_2_0_openapi_yaml__validate index ae814e57c..6242d574c 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/probely_com_1_2_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/probely_com_1_2_0_openapi_yaml__validate @@ -1,12 +1 @@ -invalid components: schema "Account": invalid example: unhandled value of type time.Time -Schema: - { - "description": "Date of next billing", - "example": "2018-01-31T16:32:17.238553Z", - "format": "date", - "readOnly": true, - "type": "string" - } - -Value: - "2018-01-31T16:32:17.238553Z" +invalid components: schema "Account": invalid example: string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/rebilly_com_2_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/rebilly_com_2_1_openapi_yaml__validate index a0eebd2ce..164870ca1 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/rebilly_com_2_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/rebilly_com_2_1_openapi_yaml__validate @@ -1,12 +1 @@ -invalid components: schema "AML": invalid example: unhandled value of type time.Time -Schema: - { - "description": "Date of birth.", - "example": "1706-01-17T00:00:00Z", - "format": "date", - "readOnly": true, - "type": "string" - } - -Value: - "1706-01-17T00:00:00Z" +invalid components: schema "AML": invalid example: string doesn't match the format "date": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/rentcast_io_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/rentcast_io_1_0_openapi_yaml__validate index 40b3cdf2e..fe6355c60 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/rentcast_io_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/rentcast_io_1_0_openapi_yaml__validate @@ -1,4 +1,4 @@ -invalid paths: invalid path /avm/rent/long-term: invalid operation GET: invalid example: validation failed due to: at '': invalid jsonType time.Time +invalid paths: invalid path /avm/rent/long-term: invalid operation GET: invalid example: example Response: validation failed due to: at '': got string, want object Schema: null diff --git a/openapi3/testdata/apis_guru_openapi_directory/salesloft_com_v2_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/salesloft_com_v2_openapi_yaml__validate index 58bfc353a..473f15ed2 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/salesloft_com_v2_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/salesloft_com_v2_openapi_yaml__validate @@ -1,11 +1,14 @@ -invalid components: schema "Account": invalid example: unhandled value of type time.Time +invalid components: schema "ActivityHistory": invalid example: value must be an object Schema: { - "description": "Datetime of when the Account was archived, if archived", - "example": "2022-01-01T00:00:00-05:00", - "format": "date-time", - "type": "string" + "description": "A list of remote resource names that failed to load. This is specific to the type of activity and may change over time. Not returned for create requests", + "example": [ + "email" + ], + "type": "object" } Value: - "2022-01-01T00:00:00-05:00" + [ + "email" + ] diff --git a/openapi3/testdata/apis_guru_openapi_directory/sendgrid_com_1_0_0_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/sendgrid_com_1_0_0_openapi_yaml__load index f6be00efb..e5fb18fb8 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/sendgrid_com_1_0_0_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/sendgrid_com_1_0_0_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: control characters are not allowed +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: control characters are not allowed diff --git a/openapi3/testdata/apis_guru_openapi_directory/shipengine_com_1_1_202304191404_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/shipengine_com_1_1_202304191404_openapi_yaml__validate index 338beeca3..1fd00f26e 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/shipengine_com_1_1_202304191404_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/shipengine_com_1_1_202304191404_openapi_yaml__validate @@ -1,13 +1,11 @@ -invalid components: schema "account_settings_images": invalid allOf element: invalid example: unhandled value of type time.Time +invalid components: schema "address_validating_shipment": invalid allOf element: invalid example: value must be a string Schema: { - "description": "An [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) string that represents a date and time.\n", - "example": "2018-09-23T15:00:00Z", - "format": "date-time", - "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[-+]\\d{2}:\\d{2})$", - "title": "date_time", + "description": "The National Motor Freight Traffic Association [freight class](http://www.nmfta.org/pages/nmfc?AspxAutoDetectCookieSupport=1), such as \"77.5\", \"110\", or \"250\".\n", + "example": 77.5, + "nullable": true, "type": "string" } Value: - "2018-09-23T15:00:00Z" + 77.5 diff --git a/openapi3/testdata/apis_guru_openapi_directory/shutterstock_com_1_1_32_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/shutterstock_com_1_1_32_openapi_yaml__validate index 0b0bc4b68..98d64af2d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/shutterstock_com_1_1_32_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/shutterstock_com_1_1_32_openapi_yaml__validate @@ -1,20 +1,27 @@ -invalid components: schema "Allotment": invalid example: Error at "/end_time": unhandled value of type time.Time +invalid components: schema "AudioUrl": invalid example: Error at "/url": property "url" is missing Schema: { - "description": "Date the subscription ends", - "format": "date-time", - "type": "string" + "description": "Audio License URL object", + "example": { + "$ref": "#/components/schemas/Url/example" + }, + "properties": { + "shorts_loops_stems": { + "description": "URL that can be used to download the .zip file containing shorts, loops, and stems", + "type": "string" + }, + "url": { + "description": "URL that can be used to download the unwatermarked, licensed asset", + "type": "string" + } + }, + "required": [ + "url" + ], + "type": "object" } Value: - "2020-05-29T12:10:22-05:00" - | Error at "/start_time": unhandled value of type time.Time -Schema: { - "description": "Date the subscription started", - "format": "date-time", - "type": "string" + "$ref": "#/components/schemas/Url/example" } - -Value: - "2020-05-29T12:10:22-05:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/snyk_io_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/snyk_io_1_0_0_openapi_yaml__validate index 945bcd8f5..8ba66eb30 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/snyk_io_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/snyk_io_1_0_0_openapi_yaml__validate @@ -1,8 +1,8 @@ -invalid paths: invalid path /group/{groupId}/audit: invalid operation POST: invalid example: unhandled value of type time.Time +invalid paths: invalid path /group/{groupId}/audit: invalid operation POST: invalid example: value must be a number Schema: { - "type": "string" + "type": "number" } Value: - "2019-07-01T00:00:00Z" + "1" diff --git a/openapi3/testdata/apis_guru_openapi_directory/squareup_com_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/squareup_com_2_0_openapi_yaml__validate index ec5b5e3e8..ac67f7960 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/squareup_com_2_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/squareup_com_2_0_openapi_yaml__validate @@ -1,35 +1,147 @@ -invalid components: schema "AcceptDisputeResponse": invalid example: Error at "/dispute/created_at": unhandled value of type time.Time +invalid components: schema "AccumulateLoyaltyPointsRequest": invalid example: Error at "/accumulate_points": property "accumulate_points" is missing Schema: { - "description": "The timestamp when the dispute was created, in RFC 3339 format.", - "maxLength": 40, - "minLength": 1, - "type": "string", - "x-read-only": true + "description": "A request to accumulate points for a purchase.", + "example": { + "request_body": { + "accumulate_points": { + "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY" + }, + "idempotency_key": "58b90739-c3e8-4b11-85f7-e636d48d72cb", + "location_id": "P034NEENMD09F" + }, + "request_params": "?account_id=5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd" + }, + "properties": { + "accumulate_points": { + "$ref": "#/components/schemas/LoyaltyEventAccumulatePoints" + }, + "idempotency_key": { + "description": "A unique string that identifies the `AccumulateLoyaltyPoints` request. \nKeys can be any valid string but must be unique for every request.", + "maxLength": 128, + "minLength": 1, + "type": "string" + }, + "location_id": { + "description": "The [location](https://developer.squareup.com/reference/square_2021-08-18/objects/Location) where the purchase was made.", + "type": "string" + } + }, + "required": [ + "accumulate_points", + "idempotency_key", + "location_id" + ], + "type": "object", + "x-release-status": "PUBLIC" } Value: - "2018-10-18T15:59:13.613Z" - | Error at "/dispute/due_at": unhandled value of type time.Time + { + "request_body": { + "accumulate_points": { + "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY" + }, + "idempotency_key": "58b90739-c3e8-4b11-85f7-e636d48d72cb", + "location_id": "P034NEENMD09F" + }, + "request_params": "?account_id=5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd" + } + | Error at "/idempotency_key": property "idempotency_key" is missing Schema: { - "description": "The time when the next action is due, in RFC 3339 format.", - "maxLength": 40, - "minLength": 1, - "type": "string" + "description": "A request to accumulate points for a purchase.", + "example": { + "request_body": { + "accumulate_points": { + "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY" + }, + "idempotency_key": "58b90739-c3e8-4b11-85f7-e636d48d72cb", + "location_id": "P034NEENMD09F" + }, + "request_params": "?account_id=5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd" + }, + "properties": { + "accumulate_points": { + "$ref": "#/components/schemas/LoyaltyEventAccumulatePoints" + }, + "idempotency_key": { + "description": "A unique string that identifies the `AccumulateLoyaltyPoints` request. \nKeys can be any valid string but must be unique for every request.", + "maxLength": 128, + "minLength": 1, + "type": "string" + }, + "location_id": { + "description": "The [location](https://developer.squareup.com/reference/square_2021-08-18/objects/Location) where the purchase was made.", + "type": "string" + } + }, + "required": [ + "accumulate_points", + "idempotency_key", + "location_id" + ], + "type": "object", + "x-release-status": "PUBLIC" } Value: - "2018-11-01T00:00:00Z" - | Error at "/dispute/updated_at": unhandled value of type time.Time + { + "request_body": { + "accumulate_points": { + "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY" + }, + "idempotency_key": "58b90739-c3e8-4b11-85f7-e636d48d72cb", + "location_id": "P034NEENMD09F" + }, + "request_params": "?account_id=5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd" + } + | Error at "/location_id": property "location_id" is missing Schema: { - "description": "The timestamp when the dispute was last updated, in RFC 3339 format.", - "maxLength": 40, - "minLength": 1, - "type": "string", - "x-read-only": true + "description": "A request to accumulate points for a purchase.", + "example": { + "request_body": { + "accumulate_points": { + "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY" + }, + "idempotency_key": "58b90739-c3e8-4b11-85f7-e636d48d72cb", + "location_id": "P034NEENMD09F" + }, + "request_params": "?account_id=5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd" + }, + "properties": { + "accumulate_points": { + "$ref": "#/components/schemas/LoyaltyEventAccumulatePoints" + }, + "idempotency_key": { + "description": "A unique string that identifies the `AccumulateLoyaltyPoints` request. \nKeys can be any valid string but must be unique for every request.", + "maxLength": 128, + "minLength": 1, + "type": "string" + }, + "location_id": { + "description": "The [location](https://developer.squareup.com/reference/square_2021-08-18/objects/Location) where the purchase was made.", + "type": "string" + } + }, + "required": [ + "accumulate_points", + "idempotency_key", + "location_id" + ], + "type": "object", + "x-release-status": "PUBLIC" } Value: - "2018-10-18T15:59:13.613Z" + { + "request_body": { + "accumulate_points": { + "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY" + }, + "idempotency_key": "58b90739-c3e8-4b11-85f7-e636d48d72cb", + "location_id": "P034NEENMD09F" + }, + "request_params": "?account_id=5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd" + } diff --git a/openapi3/testdata/apis_guru_openapi_directory/statsocial_com_1_0_0_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/statsocial_com_1_0_0_openapi_yaml__load new file mode 100644 index 000000000..099ffe7fb --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/statsocial_com_1_0_0_openapi_yaml__load @@ -0,0 +1 @@ +map key "18_24" not found diff --git a/openapi3/testdata/apis_guru_openapi_directory/telnyx_com_2_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/telnyx_com_2_0_0_openapi_yaml__validate index 9a17822ca..78b05cc87 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/telnyx_com_2_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/telnyx_com_2_0_0_openapi_yaml__validate @@ -1,10 +1,10 @@ -invalid components: schema "Address": invalid example: unhandled value of type time.Time +invalid components: schema "BillingGroup": invalid example: Error at "/deleted_at": Value is not nullable Schema: { - "description": "ISO 8601 formatted date indicating when the resource was created.", - "example": "2018-02-02T22:25:27.521Z", + "description": "ISO 8601 formatted date indicating when the resource was removed.", + "format": "date-time", "type": "string" } Value: - "2018-02-02T22:25:27.521Z" + null diff --git a/openapi3/testdata/apis_guru_openapi_directory/twinehealth_com_v7_78_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/twinehealth_com_v7_78_1_openapi_yaml__validate index 2c5a34a02..59bf42ee6 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/twinehealth_com_v7_78_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/twinehealth_com_v7_78_1_openapi_yaml__validate @@ -1,10 +1,9 @@ -invalid components: schema "ArchiveHistory": invalid example: unhandled value of type time.Time +invalid components: schema "CalendarEventResource": invalid example: Error at "/attributes/completed_by": value must be an object Schema: { - "example": "2016-06-03T13:15:22Z", - "format": "dateTime", - "type": "string" + "description": "The coach who marked the calendar event as completed. Only valid for `plan-check-in` event type.", + "type": "object" } Value: - "2016-06-03T13:15:22Z" + "5a0c8e27a9d454cc150997c9" diff --git a/openapi3/testdata/apis_guru_openapi_directory/twitter_com_current_2_62_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/twitter_com_current_2_62_openapi_yaml__validate index d8a44ada4..0a83aee3a 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/twitter_com_current_2_62_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/twitter_com_current_2_62_openapi_yaml__validate @@ -1,11 +1,267 @@ -invalid components: schema "ComplianceJob": invalid example: unhandled value of type time.Time +invalid components: schema "Expansions": invalid example: Error at "/created_at": string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" | Error at "/edit_history_tweet_ids": property "edit_history_tweet_ids" is missing Schema: { - "description": "Creation time of the compliance job.", - "example": "2021-01-06T18:40:40Z", - "format": "date-time", - "type": "string" + "example": { + "author_id": "2244994945", + "created_at": "Wed Jan 06 18:40:40 +0000 2021", + "id": "1346889436626259968", + "text": "Learn how to use the user Tweet timeline and user mention timeline endpoints in the Twitter API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i" + }, + "properties": { + "attachments": { + "description": "Specifies the type of attachments (if any) present in this Tweet.", + "properties": { + "media_keys": { + "description": "A list of Media Keys for each one of the media attachments (if media are attached).", + "items": { + "$ref": "#/components/schemas/MediaKey" + }, + "minItems": 1, + "type": "array" + }, + "poll_ids": { + "description": "A list of poll IDs (if polls are attached).", + "items": { + "$ref": "#/components/schemas/PollId" + }, + "minItems": 1, + "type": "array" + } + }, + "type": "object" + }, + "author_id": { + "$ref": "#/components/schemas/UserId" + }, + "context_annotations": { + "items": { + "$ref": "#/components/schemas/ContextAnnotation" + }, + "minItems": 1, + "type": "array" + }, + "conversation_id": { + "$ref": "#/components/schemas/TweetId" + }, + "created_at": { + "description": "Creation time of the Tweet.", + "example": "2021-01-06T18:40:40.000Z", + "format": "date-time", + "type": "string" + }, + "edit_controls": { + "properties": { + "editable_until": { + "description": "Time when Tweet is no longer editable.", + "example": "2021-01-06T18:40:40.000Z", + "format": "date-time", + "type": "string" + }, + "edits_remaining": { + "description": "Number of times this Tweet can be edited.", + "type": "integer" + }, + "is_edit_eligible": { + "description": "Indicates if this Tweet is eligible to be edited.", + "example": false, + "type": "boolean" + } + }, + "required": [ + "is_edit_eligible", + "editable_until", + "edits_remaining" + ], + "type": "object" + }, + "edit_history_tweet_ids": { + "description": "A list of Tweet Ids in this Tweet chain.", + "items": { + "$ref": "#/components/schemas/TweetId" + }, + "minItems": 1, + "type": "array" + }, + "entities": { + "$ref": "#/components/schemas/FullTextEntities" + }, + "geo": { + "description": "The location tagged on the Tweet, if the user provided one.", + "properties": { + "coordinates": { + "$ref": "#/components/schemas/Point" + }, + "place_id": { + "$ref": "#/components/schemas/PlaceId" + } + }, + "type": "object" + }, + "id": { + "$ref": "#/components/schemas/TweetId" + }, + "in_reply_to_user_id": { + "$ref": "#/components/schemas/UserId" + }, + "lang": { + "description": "Language of the Tweet, if detected by Twitter. Returned as a BCP47 language tag.", + "example": "en", + "type": "string" + }, + "non_public_metrics": { + "description": "Nonpublic engagement metrics for the Tweet at the time of the request.", + "properties": { + "impression_count": { + "description": "Number of times this Tweet has been viewed.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, + "organic_metrics": { + "description": "Organic nonpublic engagement metrics for the Tweet at the time of the request.", + "properties": { + "impression_count": { + "description": "Number of times this Tweet has been viewed.", + "type": "integer" + }, + "like_count": { + "description": "Number of times this Tweet has been liked.", + "type": "integer" + }, + "reply_count": { + "description": "Number of times this Tweet has been replied to.", + "type": "integer" + }, + "retweet_count": { + "description": "Number of times this Tweet has been Retweeted.", + "type": "integer" + } + }, + "required": [ + "impression_count", + "retweet_count", + "reply_count", + "like_count" + ], + "type": "object" + }, + "possibly_sensitive": { + "description": "Indicates if this Tweet contains URLs marked as sensitive, for example content suitable for mature audiences.", + "example": false, + "type": "boolean" + }, + "promoted_metrics": { + "description": "Promoted nonpublic engagement metrics for the Tweet at the time of the request.", + "properties": { + "impression_count": { + "description": "Number of times this Tweet has been viewed.", + "format": "int32", + "type": "integer" + }, + "like_count": { + "description": "Number of times this Tweet has been liked.", + "format": "int32", + "type": "integer" + }, + "reply_count": { + "description": "Number of times this Tweet has been replied to.", + "format": "int32", + "type": "integer" + }, + "retweet_count": { + "description": "Number of times this Tweet has been Retweeted.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, + "public_metrics": { + "description": "Engagement metrics for the Tweet at the time of the request.", + "properties": { + "impression_count": { + "description": "Number of times this Tweet has been viewed.", + "format": "int32", + "type": "integer" + }, + "like_count": { + "description": "Number of times this Tweet has been liked.", + "type": "integer" + }, + "quote_count": { + "description": "Number of times this Tweet has been quoted.", + "type": "integer" + }, + "reply_count": { + "description": "Number of times this Tweet has been replied to.", + "type": "integer" + }, + "retweet_count": { + "description": "Number of times this Tweet has been Retweeted.", + "type": "integer" + } + }, + "required": [ + "retweet_count", + "reply_count", + "like_count", + "impression_count" + ], + "type": "object" + }, + "referenced_tweets": { + "description": "A list of Tweets this Tweet refers to. For example, if the parent Tweet is a Retweet, a Quoted Tweet or a Reply, it will include the related Tweet referenced to by its parent.", + "items": { + "properties": { + "id": { + "$ref": "#/components/schemas/TweetId" + }, + "type": { + "enum": [ + "retweeted", + "quoted", + "replied_to" + ], + "type": "string" + } + }, + "required": [ + "type", + "id" + ], + "type": "object" + }, + "minItems": 1, + "type": "array" + }, + "reply_settings": { + "$ref": "#/components/schemas/ReplySettings" + }, + "source": { + "description": "This is deprecated.", + "type": "string" + }, + "text": { + "$ref": "#/components/schemas/TweetText" + }, + "withheld": { + "$ref": "#/components/schemas/TweetWithheld" + } + }, + "required": [ + "id", + "text", + "edit_history_tweet_ids" + ], + "type": "object" } Value: - "2021-01-06T18:40:40Z" + { + "author_id": "2244994945", + "created_at": "Wed Jan 06 18:40:40 +0000 2021", + "id": "1346889436626259968", + "text": "Learn how to use the user Tweet timeline and user mention timeline endpoints in the Twitter API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i" + } diff --git a/openapi3/testdata/apis_guru_openapi_directory/unicourt_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/unicourt_com_1_0_0_openapi_yaml__validate index ad2c8a18c..0dc66a53a 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/unicourt_com_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/unicourt_com_1_0_0_openapi_yaml__validate @@ -1,13 +1,13 @@ -invalid components: schema "AccessTokenIdListResponse": invalid example: unhandled value of type time.Time +invalid components: schema "Case": invalid example: minimum string length is 18 Schema: { - "description": "Date when access token was created.", - "example": "2022-11-10T10:17:56Z", - "format": "date-time", - "maxLength": 25, - "minLength": 25, + "description": "Document ID which is the parent document for the current document. This will be null if the current document is a parent document.", + "example": "CDOC3Ygn4ooAvNjHv", + "maxLength": 18, + "minLength": 18, + "nullable": true, "type": "string" } Value: - "2022-11-10T10:17:56Z" + "CDOC3Ygn4ooAvNjHv" diff --git a/openapi3/testdata/apis_guru_openapi_directory/va_gov_benefits_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/va_gov_benefits_1_0_0_openapi_yaml__validate index e44370dc4..46db592e8 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/va_gov_benefits_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/va_gov_benefits_1_0_0_openapi_yaml__validate @@ -1,11 +1,10 @@ -invalid components: schema "DocumentUploadAttributes": invalid example: unhandled value of type time.Time +invalid components: schema "DocumentUploadStatus": invalid example: value must be an integer Schema: { - "description": "The last time the submission was updated", - "example": "2018-07-30T17:31:15.958Z", - "format": "date-time", - "type": "string" + "description": "The document height", + "example": "11.0", + "type": "integer" } Value: - "2018-07-30T17:31:15.958Z" + "11.0" diff --git a/openapi3/testdata/apis_guru_openapi_directory/va_gov_forms_0_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/va_gov_forms_0_0_0_openapi_yaml__validate index 2c20a9fa3..f7ab00f5d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/va_gov_forms_0_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/va_gov_forms_0_0_0_openapi_yaml__validate @@ -1,12 +1,10 @@ -invalid components: schema "FormShow": invalid example: unhandled value of type time.Time +invalid components: schema "FormShow": invalid example: value must be a boolean Schema: { - "description": "Internal field for VA.gov use", - "example": "2021-03-30T16:28:30.338Z", - "format": "date-time", - "nullable": true, - "type": "string" + "description": "A flag indicating whether the form url was confirmed as a valid download", + "example": "true", + "type": "boolean" } Value: - "2021-03-30T16:28:30.338Z" + "true" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vercel_com_0_0_1_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/vercel_com_0_0_1_openapi_yaml__load index 44dd91250..2a6522f53 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vercel_com_0_0_1_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/vercel_com_0_0_1_openapi_yaml__load @@ -1,2 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: unmarshal errors: - line 860: cannot unmarshal !!bool `false` into openapi3.SchemaBis +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal bool into field Schema.properties of type openapi3.Schema diff --git a/openapi3/testdata/apis_guru_openapi_directory/viator_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/viator_com_1_0_0_openapi_yaml__validate index 67faf17d3..d6d4c760b 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/viator_com_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/viator_com_1_0_0_openapi_yaml__validate @@ -1,18 +1,225 @@ -invalid paths: invalid path /available/products: invalid operation POST: invalid example: Error at "/endDate": unhandled value of type time.Time +invalid paths: invalid path /available/products: invalid operation POST: invalid example: example 1: doesn't match schema due to: Error at "/errorMessage": value must be an array Schema: { - "description": "**end date** of the date range to search within (must be in the future)", + "description": "**array** of error message strings", + "items": {}, + "nullable": true, + "type": "array" + } + +Value: + { + "$ref": "#/components/examples/product-example-1/value/data/pas" + } + | Error at "/errorMessageText": value must be a string +Schema: + { + "description": "**array** of error message strings in plain text", + "nullable": true, + "type": "string" + } + +Value: + { + "$ref": "#/components/examples/product-example-1/value/data/pas" + } + | Error at "/errorName": value must be a string +Schema: + { + "description": "**name** of *this* type of error", + "nullable": true, + "type": "string" + } + +Value: + { + "$ref": "#/components/examples/product-example-1/value/data/pas" + } + | Error at "/errorReference": value must be a string +Schema: + { + "description": "**reference number** of *this* error", + "nullable": true, + "type": "string" + } + +Value: + { + "$ref": "#/components/examples/product-example-1/value/data/pas" + } + | Error at "/errorType": value must be a string +Schema: + { + "description": "**code** specifying the type of error", + "nullable": true, + "type": "string" + } + +Value: + { + "$ref": "#/components/examples/product-example-1/value/data/pas" + } + And Error at "/data/0/admission": value must be a string +Schema: + { + "description": "ignore (Viator only)", + "type": "string" + } + +Value: + { + "$ref": "#/components/examples/product-example-1/value/data/pas" + } + | Error at "/data/0/essential": value must be a string +Schema: + { + "description": "ignore (Viator only)", + "type": "string" + } + +Value: + { + "$ref": "#/components/examples/product-example-1/value/data/pas" + } + | Error at "/data/0/onRequestPeriod": value must be an integer +Schema: + { + "description": "**number** of hours before the travel date that *this* product will be 'on-request' for\n- this field will contain a value if the `bookingEngineId` is `'FreesaleOnRequestBE'`\n- an `onRequestPeriod` of 48 hours means that *this* product is freesale up until 48 hours before the travel date, and is on-request for 48 hours or less until the travel date\n- **note**: 'hours in advance' (the number of hours a product is available for booking before the travel date) may also affect this; however, this value is not available in the API\n", + "nullable": true, + "type": "integer" + } + +Value: + { + "$ref": "#/components/examples/product-example-1/value/data/pas" + } + | Error at "/data/0/primaryGroupId": value must be a string +Schema: + { + "description": "ignore (Viator only)", + "type": "string" + } + +Value: + { + "$ref": "#/components/examples/product-example-1/value/data/pas" + } + | Error at "/data/0/savingAmount": value must be a string +Schema: + { + "description": "Ignore (Viator only)\n", + "type": "string" + } + +Value: + 0 + | Error at "/data/0/specialReservationDetails": value must be a string +Schema: + { + "description": "ignore (Viator only)", + "type": "string" + } + +Value: + { + "$ref": "#/components/examples/product-example-1/value/data/pas" + } + | Error at "/data/0/uniqueShortDescription": value must be a string +Schema: + { + "description": "**natural-language description** of *this* product", + "type": "string" + } + +Value: + { + "$ref": "#/components/examples/product-example-1/value/data/pas" + } + | Error at "/data/0/webURL": value must be a string +Schema: + { + "description": "ignore (Viator only)", + "nullable": true, + "type": "string" + } + +Value: + { + "$ref": "#/components/examples/product-example-1/value/data/pas" + } + | Error at "/data/1/admission": value must be a string +Schema: + { + "description": "ignore (Viator only)", "type": "string" } Value: - "2020-12-31T00:00:00Z" - | Error at "/startDate": unhandled value of type time.Time + { + "$ref": "#/components/examples/product-example-1/value/data/pas" + } + | Error at "/data/1/essential": value must be a string Schema: { - "description": "**start date** of the date range to search within (must be in the future)", + "description": "ignore (Viator only)", "type": "string" } Value: - "2020-12-21T00:00:00Z" + { + "$ref": "#/components/examples/product-example-1/value/data/pas" + } + | Error at "/data/1/primaryGroupId": value must be a string +Schema: + { + "description": "ignore (Viator only)", + "type": "string" + } + +Value: + { + "$ref": "#/components/examples/product-example-1/value/data/pas" + } + | Error at "/data/1/savingAmount": value must be a string +Schema: + { + "description": "Ignore (Viator only)\n", + "type": "string" + } + +Value: + 0 + | Error at "/data/1/specialReservationDetails": value must be a string +Schema: + { + "description": "ignore (Viator only)", + "type": "string" + } + +Value: + { + "$ref": "#/components/examples/product-example-1/value/data/pas" + } + | Error at "/data/1/uniqueShortDescription": value must be a string +Schema: + { + "description": "**natural-language description** of *this* product", + "type": "string" + } + +Value: + { + "$ref": "#/components/examples/product-example-1/value/data/pas" + } + | Error at "/data/1/webURL": value must be a string +Schema: + { + "description": "ignore (Viator only)", + "nullable": true, + "type": "string" + } + +Value: + { + "$ref": "#/components/examples/product-example-1/value/data/pas" + } diff --git a/openapi3/testdata/apis_guru_openapi_directory/visualcrossing_com_weather_4_6_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/visualcrossing_com_weather_4_6_openapi_yaml__validate index c4cfe7b03..f814141f6 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/visualcrossing_com_weather_4_6_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/visualcrossing_com_weather_4_6_openapi_yaml__validate @@ -1,8 +1,8 @@ -invalid paths: invalid path /VisualCrossingWebServices/rest/services/timeline/{location}/{startdate}: invalid operation GET: invalid example: unhandled value of type time.Time +invalid paths: invalid path /VisualCrossingWebServices/rest/services/weatherdata/forecast: invalid operation GET: invalid example: value must be a boolean Schema: { - "type": "string" + "type": "boolean" } Value: - "2022-02-01T00:00:00Z" + "false" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vonage_com_reports_1_0_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vonage_com_reports_1_0_1_openapi_yaml__validate index d11bacf46..492766a51 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vonage_com_reports_1_0_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/vonage_com_reports_1_0_1_openapi_yaml__validate @@ -1,10 +1,10 @@ -invalid components: schema "CallLog": invalid example: unhandled value of type time.Time +invalid components: schema "CallLog": invalid example: value must be a string Schema: { - "description": "End time of the call", - "example": "2019-01-01T00:00:00Z", + "description": "Source number of the call", + "example": 17325550100, "type": "string" } Value: - "2019-01-01T00:00:00Z" + 17325550100 diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Catalog_API_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Catalog_API_1_0_openapi_yaml__validate index dd8702286..83eb9c663 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Catalog_API_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Catalog_API_1_0_openapi_yaml__validate @@ -1,10 +1 @@ -invalid components: schema "GetSKUAltID": invalid example: Error at "/ReleaseDate": unhandled value of type time.Time -Schema: - { - "description": "Release date of the product.", - "nullable": true, - "type": "string" - } - -Value: - "2020-01-06T00:00:00Z" +invalid paths: conflicting paths "/api/catalog/pvt/subcollection/{subCollectionId}/brand/{categoryId}" and "/api/catalog/pvt/subcollection/{subCollectionId}/brand/{brandId}" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Catalog_API_Seller_Portal_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Catalog_API_Seller_Portal_1_0_0_openapi_yaml__validate index b16bc2b99..e98368b50 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Catalog_API_Seller_Portal_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Catalog_API_Seller_Portal_1_0_0_openapi_yaml__validate @@ -1,11 +1 @@ -invalid paths: invalid path /api/catalog-seller-portal/brands: invalid operation GET: invalid example: unhandled value of type time.Time -Schema: - { - "description": "Date when the brand was created.", - "example": "2021-01-18T14:41:45.696488Z", - "title": "createdAt", - "type": "string" - } - -Value: - "2021-01-18T14:41:45.696488Z" +invalid paths: conflicting paths "/api/catalog-seller-portal/products/{productId}" and "/api/catalog-seller-portal/products/{param}" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Checkout_API_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Checkout_API_1_0_openapi_yaml__validate index 039a70561..bf6d441f5 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Checkout_API_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Checkout_API_1_0_openapi_yaml__validate @@ -1,13 +1,4 @@ -invalid paths: invalid path /api/checkout/pub/orderForm/{orderFormId}/coupons: invalid operation POST: invalid example: example response: Error at "/items/0/priceValidUntil": unhandled value of type time.Time -Schema: - { - "description": "Price expiration date and time.", - "type": "string" - } - -Value: - "2022-07-13T18:30:46Z" - | Error at "/shippingData/logisticsInfo/0/slas/0/deliveryIds/0/warehouseId": value must be a string +invalid paths: invalid path /api/checkout/pub/orderForm/{orderFormId}/coupons: invalid operation POST: invalid example: example response: Error at "/shippingData/logisticsInfo/0/slas/0/deliveryIds/0/warehouseId": value must be a string Schema: { "description": "Warehouse ID.", diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Customer_Credit_API_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Customer_Credit_API_1_0_openapi_yaml__validate index 1766f791d..d57c88ea8 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Customer_Credit_API_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Customer_Credit_API_1_0_openapi_yaml__validate @@ -1,8 +1,10 @@ -invalid components: schema "Datum2": invalid example: Error at "/lastUpdate": unhandled value of type time.Time +invalid paths: invalid path /api/creditcontrol/accounts/{accountId}: invalid operation PUT: invalid default: value must be an integer Schema: { - "type": "string" + "default": "100.0", + "description": "If the user don't set a credit limit, the system will define 100 for default", + "type": "integer" } Value: - "2017-07-06T01:57:39.4317119Z" + "100.0" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Marketplace_Protocol_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Marketplace_Protocol_1_0_openapi_yaml__validate index d7d10a6d8..40adbc080 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Marketplace_Protocol_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Marketplace_Protocol_1_0_openapi_yaml__validate @@ -1,10 +1,9 @@ -invalid components: schema "orderPlacement": invalid example: unhandled value of type time.Time +invalid paths: invalid path /api/checkout/pub/orderForms/simulation: invalid operation POST: invalid example: Error at "/logisticsInfo/0/slas/0/deliveryIds/0/warehouseId": value must be a string Schema: { - "description": "Scheduled delivery window end date in UTC.", - "example": "2016-04-20T12:00:00Z", + "description": "Warehouse ID.", "type": "string" } Value: - "2016-04-20T12:00:00Z" + 11 diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Orders_API_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Orders_API_1_0_openapi_yaml__validate index fee48a580..41725b9d4 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Orders_API_1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Orders_API_1_0_openapi_yaml__validate @@ -1,9 +1,9 @@ -invalid components: schema "ChangesAttachment": invalid example: Error at "/date": unhandled value of type time.Time +invalid components: schema "DeliveryId": invalid example: Error at "/warehouseId": value must be a string Schema: { - "description": "Date when the receipt was created.", + "description": "ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb).", "type": "string" } Value: - "2019-02-06T20:46:04.4003606Z" + 11 diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Orders_API__PII_version__1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Orders_API__PII_version__1_0_openapi_yaml__validate index 23ca7a968..c811d26df 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Orders_API__PII_version__1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Orders_API__PII_version__1_0_openapi_yaml__validate @@ -1,9 +1,9 @@ -invalid components: schema "ChangesAttachment": invalid example: Error at "/date": unhandled value of type time.Time +invalid components: schema "DeliveryId": invalid example: Error at "/warehouseId": value must be a string Schema: { - "description": "Date.", + "description": "Warehouse ID.", "type": "string" } Value: - "2019-02-06T20:46:04.4003606Z" + 11 diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Subscriptions_API__v2__1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Subscriptions_API__v2__1_0_openapi_yaml__validate index 2c634e169..8353ea5f0 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Subscriptions_API__v2__1_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Subscriptions_API__v2__1_0_openapi_yaml__validate @@ -1,16 +1,18 @@ -invalid components: schema "Item1": invalid example: Error at "/createdAt": unhandled value of type time.Time +invalid components: schema "settings": invalid example: value must be an array Schema: { - "type": "string" + "default": [], + "description": "Array containing delivery channels.", + "example": "delivery", + "items": { + "default": "", + "description": "Type of delivery channel. The values that are possible are: `pickup-in-point` for pickup point and `delivery` for regular delivery.", + "example": "delivery", + "type": "string" + }, + "title": "deliveryChannels", + "type": "array" } Value: - "2019-06-20T18:27:41.23Z" - | Error at "/lastUpdate": unhandled value of type time.Time -Schema: - { - "type": "string" - } - -Value: - "2019-06-20T18:27:41.23Z" + "delivery" diff --git a/openapi3/testdata/apis_guru_openapi_directory/wealthreader_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/wealthreader_com_1_0_0_openapi_yaml__validate index 1f98f0872..38ec15062 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/wealthreader_com_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/wealthreader_com_1_0_0_openapi_yaml__validate @@ -1,10 +1,10 @@ -invalid components: schema "accounts": invalid example: unhandled value of type time.Time +invalid components: schema "entities": invalid example: value must be a boolean Schema: { - "example": "2022-12-30T00:00:00Z", - "format": "date", - "type": "string" + "description": "Indica si el campo es requerido", + "example": 0, + "type": "boolean" } Value: - "2022-12-30T00:00:00Z" + 0 diff --git a/openapi3/testdata/apis_guru_openapi_directory/zuora_com_2021_08_20_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/zuora_com_2021_08_20_openapi_yaml__validate index 368949863..0fef903bc 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/zuora_com_2021_08_20_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/zuora_com_2021_08_20_openapi_yaml__validate @@ -1,10 +1,197 @@ -invalid components: schema "ApplyCreditMemoType": invalid example: Error at "/effectiveDate": unhandled value of type time.Time +invalid components: schema "CreditMemoFromChargeType": invalid example: doesn't match schema due to: Error at "/charges/0": doesn't match schema due to: Error at "/amount": Value is not nullable Schema: { - "description": "The date when the credit memo is applied.\n", - "format": "date", - "type": "string" + "description": "The amount of the credit memo item.\n\n**Note**: This field is only available if you set the `zuora-version` request header to `224.0` or later.\n", + "format": "double", + "type": "number" } Value: - "2017-03-02T00:00:00Z" + null + | Error at "/productRatePlanChargeId": property "productRatePlanChargeId" is missing +Schema: + { + "properties": { + "amount": { + "description": "The amount of the credit memo item.\n\n**Note**: This field is only available if you set the `zuora-version` request header to `224.0` or later.\n", + "format": "double", + "type": "number" + }, + "chargeId": { + "description": "The ID of the product rate plan charge that the credit memo is created from.\n\n**Note**: This field is not available if you set the `zuora-version` request header to `257.0` or later.\n", + "type": "string" + }, + "comment": { + "description": "Comments about the product rate plan charge.\n\n**Note**: This field is not available if you set the `zuora-version` request header to `257.0` or later.\n", + "maxLength": 255, + "type": "string" + }, + "description": { + "description": "The description of the product rate plan charge.\n\n**Note**: This field is only available if you set the `zuora-version` request header to `257.0` or later.\n", + "maxLength": 255, + "type": "string" + }, + "financeInformation": { + "description": "Container for the finance information related to the product rate plan charge associated with the credit memo.\n", + "properties": { + "deferredRevenueAccountingCode": { + "description": "The accounting code for the deferred revenue, such as Monthly Recurring Liability.\n", + "maxLength": 100, + "type": "string" + }, + "onAccountAccountingCode": { + "description": "The accounting code that maps to an on account in your accounting system.\n", + "maxLength": 100, + "type": "string" + }, + "recognizedRevenueAccountingCode": { + "description": "The accounting code for the recognized revenue, such as Monthly Recurring Charges or Overage Charges.\n", + "maxLength": 100, + "type": "string" + }, + "revenueRecognitionRuleName": { + "description": "The name of the revenue recognition rule governing the revenue schedule.\n", + "maxLength": 100, + "type": "string" + } + }, + "type": "object" + }, + "memoItemAmount": { + "description": "The amount of the credit memo item.\n\n**Note**: This field is not available if you set the `zuora-version` request header to `224.0` or later.\n", + "format": "double", + "type": "number" + }, + "productRatePlanChargeId": { + "description": "The ID of the product rate plan charge that the credit memo is created from.\n\n**Note**: This field is only available if you set the `zuora-version` request header to `257.0` or later.\n", + "type": "string" + }, + "quantity": { + "description": "The number of units for the credit memo item.\n", + "format": "double", + "type": "number" + }, + "serviceEndDate": { + "description": "The service end date of the credit memo item. If not specified, the effective end date of the corresponding product rate plan will be used.\n", + "format": "date", + "type": "string" + }, + "serviceStartDate": { + "description": "The service start date of the credit memo item. If not specified, the effective start date of the corresponding product rate plan will be used.\n", + "format": "date", + "type": "string" + } + }, + "required": [ + "chargeId", + "productRatePlanChargeId" + ], + "type": "object" + } + +Value: + { + "amount": null, + "chargeId": "402890555a87d7f5015a88c613c5001e", + "comment": "this is comment1", + "quantity": 1, + "serviceEndDate": "2018-10-17", + "serviceStartDate": "2017-10-17" + } + And Error at "/amount": Value is not nullable +Schema: + { + "description": "Custom fields of the Credit Memo Item object. The name of each custom field has the form \u003ccode\u003e*customField*__c\u003c/code\u003e. Custom field names are case sensitive. See [Manage Custom Fields](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Manage_Custom_Fields) for more information.\n" + } + +Value: + null + | Error at "/charges/1": doesn't match schema due to: Error at "/productRatePlanChargeId": property "productRatePlanChargeId" is missing +Schema: + { + "properties": { + "amount": { + "description": "The amount of the credit memo item.\n\n**Note**: This field is only available if you set the `zuora-version` request header to `224.0` or later.\n", + "format": "double", + "type": "number" + }, + "chargeId": { + "description": "The ID of the product rate plan charge that the credit memo is created from.\n\n**Note**: This field is not available if you set the `zuora-version` request header to `257.0` or later.\n", + "type": "string" + }, + "comment": { + "description": "Comments about the product rate plan charge.\n\n**Note**: This field is not available if you set the `zuora-version` request header to `257.0` or later.\n", + "maxLength": 255, + "type": "string" + }, + "description": { + "description": "The description of the product rate plan charge.\n\n**Note**: This field is only available if you set the `zuora-version` request header to `257.0` or later.\n", + "maxLength": 255, + "type": "string" + }, + "financeInformation": { + "description": "Container for the finance information related to the product rate plan charge associated with the credit memo.\n", + "properties": { + "deferredRevenueAccountingCode": { + "description": "The accounting code for the deferred revenue, such as Monthly Recurring Liability.\n", + "maxLength": 100, + "type": "string" + }, + "onAccountAccountingCode": { + "description": "The accounting code that maps to an on account in your accounting system.\n", + "maxLength": 100, + "type": "string" + }, + "recognizedRevenueAccountingCode": { + "description": "The accounting code for the recognized revenue, such as Monthly Recurring Charges or Overage Charges.\n", + "maxLength": 100, + "type": "string" + }, + "revenueRecognitionRuleName": { + "description": "The name of the revenue recognition rule governing the revenue schedule.\n", + "maxLength": 100, + "type": "string" + } + }, + "type": "object" + }, + "memoItemAmount": { + "description": "The amount of the credit memo item.\n\n**Note**: This field is not available if you set the `zuora-version` request header to `224.0` or later.\n", + "format": "double", + "type": "number" + }, + "productRatePlanChargeId": { + "description": "The ID of the product rate plan charge that the credit memo is created from.\n\n**Note**: This field is only available if you set the `zuora-version` request header to `257.0` or later.\n", + "type": "string" + }, + "quantity": { + "description": "The number of units for the credit memo item.\n", + "format": "double", + "type": "number" + }, + "serviceEndDate": { + "description": "The service end date of the credit memo item. If not specified, the effective end date of the corresponding product rate plan will be used.\n", + "format": "date", + "type": "string" + }, + "serviceStartDate": { + "description": "The service start date of the credit memo item. If not specified, the effective start date of the corresponding product rate plan will be used.\n", + "format": "date", + "type": "string" + } + }, + "required": [ + "chargeId", + "productRatePlanChargeId" + ], + "type": "object" + } + +Value: + { + "amount": 20, + "chargeId": "402890555a7d4022015a7d90906b0067", + "comment": "this is comment2", + "serviceEndDate": "2018-10-17", + "serviceStartDate": "2017-10-17" + } From a50e0668bcf53465c1c60d710ffa3ea1eeb0b20e Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 14:26:49 +0300 Subject: [PATCH 09/31] Suppress YAML 1.1 timestamp resolution before decoding A date-shaped scalar such as an OpenAPI `example: 2020-06-11T16:32:50Z` resolves to a time.Time under YAML 1.1, then fails validation as an unhandled type. The previous path avoided this with a DisableTimestamps option on our yaml fork; stock go-yaml has none, so the node tree is parsed first and such scalars retagged as strings before decoding. Explicitly !!timestamp-tagged values are left alone, which is what the fork's option did. Found only by running against the apis-guru corpus: it moved 232 expected-output fixtures, and this accounts for about 100 of them. The rest are a wider version of the same problem, recorded here rather than papered over. The old path normalised every scalar through JSON's type system on its way through the round trip; decoding natively keeps YAML 1.1 semantics, so implicit resolution now applies. A spec with the key 18_24 loads it as the integer 1824, and examples and defaults whose type shifts stop being format-checked. Timestamps were one instance of a family, and the family needs a considered answer rather than another special case. --- openapi3/marsh.go | 9 +++++++-- openapi3/native_yaml.go | 22 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/openapi3/marsh.go b/openapi3/marsh.go index b97b339ce..849ace909 100644 --- a/openapi3/marsh.go +++ b/openapi3/marsh.go @@ -32,8 +32,13 @@ func unmarshal(data []byte, v any, includeOrigin bool, location *url.URL) (*orig // with origins read off the nodes. No JSON round trip, no __origin__ // channel, and JSON documents get origins too since JSON parses as YAML. originFileVar, originEnabledVar = file, includeOrigin - if err := goyaml.Unmarshal(data, v); err == nil { - return nil, nil + var root goyaml.Node + if err := goyaml.Unmarshal(data, &root); err == nil { + stripTimestamps(&root) + if err = root.Decode(v); err == nil { + return nil, nil + } + yamlErr = err } else { yamlErr = err } diff --git a/openapi3/native_yaml.go b/openapi3/native_yaml.go index 6c695cbe3..d8fd32ae3 100644 --- a/openapi3/native_yaml.go +++ b/openapi3/native_yaml.go @@ -283,3 +283,25 @@ func setOriginKey(child reflect.Value, keyNode *yaml.Node, file string) { setOriginKey(inner, keyNode, file) } } + +// stripTimestamps retags date-shaped scalars as strings. +// +// YAML 1.1 resolves an untagged scalar like 2020-06-11T16:32:50-03:00 to a +// timestamp, so an OpenAPI `example` of that shape decodes to a time.Time and +// then fails validation as an unhandled type. The previous decode path avoided +// this with a DisableTimestamps option on our yaml fork; stock go-yaml has no +// such option, so the same effect is had by retagging before decoding. +// +// Explicit !!timestamp tags in the source are left alone: those are a +// deliberate request for a time.Time, which is what the fork's option did too. +func stripTimestamps(n *yaml.Node) { + if n == nil { + return + } + if n.Kind == yaml.ScalarNode && n.Tag == "!!timestamp" && n.Style != yaml.TaggedStyle { + n.Tag = "!!str" + } + for _, c := range n.Content { + stripTimestamps(c) + } +} From 7f760b4375ff7790c90b8771e1535fd3fc176476 Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 14:50:36 +0300 Subject: [PATCH 10/31] Comments describe the code, not the change The comments on the new files read as a changelog -- comparing each function to the implementation it replaces, quoting line counts from the old one, and carrying the measurements that justified the approach. That belongs in the pull request; a reader of the code wants to know what it does now. Kept the rationale a reader cannot recover from the code: why Origin.Key cannot be set by the node that carries it, why timestamp resolution is suppressed, why the origin file is package-level. --- openapi3/native_e2e_test.go | 6 +- openapi3/native_yaml.go | 84 ++++-------- openapi3/native_yaml_refs.go | 13 +- openapi3/native_yaml_shadow.go | 12 +- openapi3/native_yaml_special.go | 20 ++- openapi3/native_yaml_test.go | 15 +- ...nceControlService_1_openapi_yaml__validate | 10 -- ...ntNotification_v1_1_openapi_yaml__validate | 10 -- ...rtNotification_v1_1_openapi_yaml__validate | 10 -- ..._com_CheckoutService_37_openapi_yaml__load | 2 +- ..._com_CheckoutService_40_openapi_yaml__load | 2 +- ..._com_CheckoutService_41_openapi_yaml__load | 2 +- ..._com_CheckoutService_46_openapi_yaml__load | 2 +- ..._com_CheckoutService_49_openapi_yaml__load | 2 +- ..._com_CheckoutService_50_openapi_yaml__load | 2 +- ..._com_CheckoutService_51_openapi_yaml__load | 2 +- ..._com_CheckoutService_52_openapi_yaml__load | 2 +- ..._com_CheckoutService_53_openapi_yaml__load | 2 +- ..._com_CheckoutService_64_openapi_yaml__load | 2 +- ..._com_CheckoutService_65_openapi_yaml__load | 2 +- ..._com_CheckoutService_66_openapi_yaml__load | 2 +- ..._com_CheckoutService_67_openapi_yaml__load | 2 +- ..._com_CheckoutService_68_openapi_yaml__load | 2 +- ..._com_CheckoutService_69_openapi_yaml__load | 2 +- ..._com_CheckoutService_70_openapi_yaml__load | 2 +- ..._CheckoutService_v71_71_openapi_yaml__load | 2 +- ...n_com_PaymentService_25_openapi_yaml__load | 2 +- ...n_com_PaymentService_30_openapi_yaml__load | 2 +- ...n_com_PaymentService_40_openapi_yaml__load | 2 +- ...n_com_PaymentService_46_openapi_yaml__load | 2 +- ...n_com_PaymentService_49_openapi_yaml__load | 2 +- ...n_com_PaymentService_50_openapi_yaml__load | 2 +- ...n_com_PaymentService_51_openapi_yaml__load | 2 +- ...n_com_PaymentService_52_openapi_yaml__load | 2 +- ...n_com_PaymentService_64_openapi_yaml__load | 2 +- ...n_com_PaymentService_67_openapi_yaml__load | 2 +- ...n_com_PaymentService_68_openapi_yaml__load | 2 +- ...om_PayoutService_30_openapi_yaml__validate | 11 -- ...om_PayoutService_40_openapi_yaml__validate | 11 -- ...en_com_PayoutService_46_openapi_yaml__load | 2 +- ...en_com_PayoutService_49_openapi_yaml__load | 2 +- ...om_PayoutService_50_openapi_yaml__validate | 11 -- ...om_PayoutService_51_openapi_yaml__validate | 11 -- ...om_PayoutService_52_openapi_yaml__validate | 11 -- ...om_PayoutService_64_openapi_yaml__validate | 11 -- ...om_PayoutService_67_openapi_yaml__validate | 11 -- ...om_PayoutService_68_openapi_yaml__validate | 11 -- ...RecurringService_25_openapi_yaml__validate | 9 -- ...RecurringService_30_openapi_yaml__validate | 9 -- ...RecurringService_40_openapi_yaml__validate | 9 -- ...RecurringService_49_openapi_yaml__validate | 9 -- ...RecurringService_67_openapi_yaml__validate | 9 -- ...RecurringService_68_openapi_yaml__validate | 9 -- ...m_TransferService_2_openapi_yaml__validate | 99 -------------- ...m_TransferService_3_openapi_yaml__validate | 99 -------------- ...ransferService_v4_4_openapi_yaml__validate | 128 ------------------ ...adeus_trip_parser_3_0_1_openapi_yaml__load | 2 +- ...deck_com_ats_10_0_0_openapi_yaml__validate | 13 -- ...deck_com_crm_10_0_0_openapi_yaml__validate | 11 -- ...tomer_support_9_5_0_openapi_yaml__validate | 13 -- ...om_ecommerce_10_0_0_openapi_yaml__validate | 14 -- ...file_storage_10_0_0_openapi_yaml__validate | 14 -- ...sue_tracking_10_0_0_openapi_yaml__validate | 14 -- ...eck_com_lead_10_0_0_openapi_yaml__validate | 13 -- ...deck_com_sms_10_0_0_openapi_yaml__validate | 14 -- ...ck_com_vault_10_0_0_openapi_yaml__validate | 10 -- ..._com_webhook_10_0_0_openapi_yaml__validate | 14 -- ...e_org_wayback_1_0_0_openapi_yaml__validate | 18 --- .../braze_com_1_0_0_openapi_yaml__validate | 9 -- .../bunq_com_1_0_openapi_yaml__load | 2 +- ...a_holidays_ca_1_8_0_openapi_yaml__validate | 11 -- .../chain49_com_2_0_openapi_yaml__validate | 40 ------ ...aingateway_io_1_0_0_openapi_yaml__validate | 9 -- ...chaingateway_io_1_0_openapi_yaml__validate | 8 -- ...dat_io_accounting_2_1_0_openapi_yaml__load | 2 +- .../codat_io_assess_1_0_openapi_yaml__load | 3 +- ...o_sync_for_commerce_1_1_openapi_yaml__load | 3 +- ...c_for_expenses_prealpha_openapi_yaml__load | 3 +- ...rencytick_com_1_0_0_openapi_yaml__validate | 10 -- .../docusign_net_v2_1_openapi_yaml__load | 2 +- .../formapi_io_v1_openapi_yaml__validate | 9 -- ...tpostman_com_1_20_0_openapi_yaml__validate | 9 -- ...ndhog_day_com_1_2_1_openapi_yaml__validate | 8 -- ...tion_preferences_v3_openapi_yaml__validate | 60 -------- ...api_com_webhooks_v3_openapi_yaml__validate | 20 --- .../icons8_com_1_0_0_openapi_yaml__validate | 8 -- ...travel_hotels_1_003_openapi_yaml__validate | 9 -- ...lityscore_com_1_0_0_openapi_yaml__validate | 9 -- ..._com_payments_1_0_0_openapi_yaml__validate | 10 -- .../meraki_com_1_32_0_openapi_yaml__validate | 10 -- ...ices_Prediction_1_1_openapi_yaml__validate | 10 -- ...ices_Prediction_2_0_openapi_yaml__validate | 10 -- ...rvices_Training_1_2_openapi_yaml__validate | 22 --- .../mux_com_v1_openapi_yaml__validate | 9 -- ...utrinoapi_net_3_6_4_openapi_yaml__validate | 10 -- ...om_conversion_1_0_1_openapi_yaml__validate | 8 -- ...xmo_com_media_1_0_2_openapi_yaml__validate | 10 -- ...nexmo_com_sms_1_2_0_openapi_yaml__validate | 10 -- ...owpayments_io_1_0_0_openapi_yaml__validate | 9 -- ...tropy_network_1_0_0_openapi_yaml__validate | 9 -- ...com_books_api_3_0_0_openapi_yaml__validate | 24 ---- .../openaq_local_2_0_0_openapi_yaml__validate | 19 --- ...ates_org_2021_11_12_openapi_yaml__validate | 10 -- ...phantauth_net_1_0_0_openapi_yaml__validate | 9 -- ...proxykingdom_com_v1_openapi_yaml__validate | 10 -- .../prss_org_2_0_0_openapi_yaml__validate | 11 -- .../qualtrics_com_0_2_openapi_yaml__validate | 9 -- ...com_ecowetter_1_0_0_openapi_yaml__validate | 8 -- .../sendgrid_com_1_0_0_openapi_yaml__load | 2 +- .../shorten_rest_1_0_0_openapi_yaml__validate | 10 -- ..._sonallux_2023_2_27_openapi_yaml__validate | 10 -- .../statsocial_com_1_0_0_openapi_yaml__load | 1 - .../taxrates_io_1_0_0_openapi_yaml__validate | 9 -- ...maticssdk_com_1_0_0_openapi_yaml__validate | 9 -- ...racingapi_com_1_0_0_openapi_yaml__validate | 11 -- ...enmetrics_com_1_0_0_openapi_yaml__validate | 9 -- .../up_com_au_v1_openapi_yaml__validate | 9 -- ..._confirmation_0_0_1_openapi_yaml__validate | 11 -- .../vercel_com_0_0_1_openapi_yaml__load | 3 +- ...al_Giftcard_API_1_0_openapi_yaml__validate | 10 -- ...MasterData_API__1_0_openapi_yaml__validate | 16 --- ...aster_Data_API__1_0_openapi_yaml__validate | 16 --- ...nts_Gateway_API_1_0_openapi_yaml__validate | 8 -- ...cal_Pricing_API_1_0_openapi_yaml__validate | 18 --- ...cal_Pricing_Hub_1_0_openapi_yaml__validate | 18 --- ..._Profile_System_1_0_openapi_yaml__validate | 10 -- ...cal_Promotions__1_0_openapi_yaml__validate | 16 --- ...and_Ratings_API_1_0_openapi_yaml__validate | 9 -- ...ocal_Search_API_1_0_openapi_yaml__validate | 11 -- ...cal_VTEX_Do_API_1_0_openapi_yaml__validate | 8 -- 130 files changed, 100 insertions(+), 1443 deletions(-) delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalanceControlService_1_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalancePlatformPaymentNotification_v1_1_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalancePlatformReportNotification_v1_1_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_30_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_40_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_50_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_51_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_52_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_64_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_67_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_68_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_25_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_30_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_40_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_49_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_67_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_68_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_2_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_3_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_v4_4_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/apideck_com_ats_10_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/apideck_com_crm_10_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/apideck_com_customer_support_9_5_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/apideck_com_ecommerce_10_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/apideck_com_file_storage_10_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/apideck_com_issue_tracking_10_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/apideck_com_lead_10_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/apideck_com_sms_10_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/apideck_com_vault_10_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/apideck_com_webhook_10_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/archive_org_wayback_1_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/braze_com_1_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/canada_holidays_ca_1_8_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/chain49_com_2_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/chaingateway_io_1_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/chaingateway_io_1_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/currencytick_com_1_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/formapi_io_v1_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/getpostman_com_1_20_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/groundhog_day_com_1_2_1_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/hubapi_com_communication_preferences_v3_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/hubapi_com_webhooks_v3_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/icons8_com_1_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/impala_travel_hotels_1_003_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/ipqualityscore_com_1_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/klarna_com_payments_1_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/meraki_com_1_32_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_1_1_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_2_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_1_2_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/mux_com_v1_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/neutrinoapi_net_3_6_4_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversion_1_0_1_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/nexmo_com_media_1_0_2_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/nexmo_com_sms_1_2_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/nowpayments_io_1_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/ntropy_network_1_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/nytimes_com_books_api_3_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/openaq_local_2_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/openstates_org_2021_11_12_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/phantauth_net_1_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/proxykingdom_com_v1_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/prss_org_2_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/qualtrics_com_0_2_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/rapidapi_com_ecowetter_1_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/shorten_rest_1_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/spotify_com_sonallux_2023_2_27_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/statsocial_com_1_0_0_openapi_yaml__load delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/taxrates_io_1_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/telematicssdk_com_1_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/theracingapi_com_1_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/tokenmetrics_com_1_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/up_com_au_v1_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/va_gov_confirmation_0_0_1_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_Giftcard_API_1_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_MasterData_API__1_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_Master_Data_API__1_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_Payments_Gateway_API_1_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_Pricing_API_1_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_Pricing_Hub_1_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_Profile_System_1_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_Promotions__1_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_Reviews_and_Ratings_API_1_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_Search_API_1_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_VTEX_Do_API_1_0_openapi_yaml__validate diff --git a/openapi3/native_e2e_test.go b/openapi3/native_e2e_test.go index d78e11019..f1a75192c 100644 --- a/openapi3/native_e2e_test.go +++ b/openapi3/native_e2e_test.go @@ -13,8 +13,8 @@ import ( goyaml "go.yaml.in/yaml/v3" ) -// The whole point: a complete document decoding through UnmarshalYAML on the -// stock parser, matching what the JSON round trip produces. +// A complete document decoded through UnmarshalYAML must equal the same +// document decoded as JSON. func TestNativeE2E_WholeDocument(t *testing.T) { // Every full document in testdata, so this is breadth rather than a // hand-picked sample. @@ -50,7 +50,7 @@ func TestNativeE2E_WholeDocument(t *testing.T) { require.Positive(t, ran, "should have found documents to compare") } -// And origins must reach the places oasdiff reads them from. +// Path items and operations must carry an origin naming their own key. func TestNativeE2E_OriginsReachOperations(t *testing.T) { defer func(v bool) { originEnabledVar = v }(originEnabledVar) originEnabledVar = true diff --git a/openapi3/native_yaml.go b/openapi3/native_yaml.go index d8fd32ae3..04f782e44 100644 --- a/openapi3/native_yaml.go +++ b/openapi3/native_yaml.go @@ -8,36 +8,21 @@ import ( yaml "go.yaml.in/yaml/v3" ) -// Native YAML decoding against stock go.yaml.in/yaml/v3 -- no fork, no patches. +// Shared machinery for the UnmarshalYAML methods: extension collection, and +// origins read from the node being decoded. // -// Today a YAML document is decoded to map[string]any, re-serialized to JSON -// text and parsed again, because these types implement UnmarshalJSON rather -// than UnmarshalYAML. Positions cannot survive that, so they are smuggled -// through it as synthetic __origin__ nodes and reapplied afterwards by a -// reflection walk over a separately-built tree. -// -// Decoding from the node directly removes both. The node carries Line and -// Column, which stock go-yaml has always had, so origins are read off it. -// -// End positions are deliberately not used. A block's extent is recoverable -// from start positions alone -- it runs to the line before the next key or -// sequence item at the same or shallower indentation -- which was measured to -// agree with recorded end positions on ~99.98% of ~11.9M spans, the remainder -// being a trailing blank-or-comment boundary convention. That is what lets -// this run on the stock parser. +// Origins record where an element starts, not where it ends. A consumer that +// needs the extent of a block derives it from the next key or sequence item at +// the same or shallower indentation. // originFileVar is the file stamped into origins for the decode in progress. -// -// UnmarshalYAML receives a node and nothing else, so the file cannot be -// threaded through the call. This follows the precedent of IncludeOrigin, -// which is already a package-level decode setting, and inherits its -// concurrency characteristics: one decode at a time per process. Making both -// per-Loader is worth doing, but is a separate change to a public API. +// UnmarshalYAML receives a node and nothing else, so the file cannot be passed +// through the call. One decode at a time per process, as with IncludeOrigin. var originFileVar string // originEnabledVar mirrors the includeOrigin argument unmarshal receives, which -// comes from the Loader rather than from the package-level IncludeOrigin. -// Gating on the global would miss a caller that set it only on its Loader. +// comes from the Loader. The package-level IncludeOrigin only seeds NewLoader, +// so a caller that set it on its Loader alone would be missed. var originEnabledVar bool func nativeOriginFile() string { return originFileVar } @@ -82,13 +67,11 @@ func knownYAMLFields(t reflect.Type) map[string]struct{} { } // decodeStructWithExtensions decodes node into out and returns the mapping keys -// out does not declare. nil rather than an empty map when there are none, -// matching the JSON path. +// out does not declare, which are the extensions. Returns nil rather than an +// empty map when there are none. // -// The JSON versions of this build the whole object as a map and then delete -// every known name from it -- Schema.UnmarshalJSON is 91 lines, about 60 of -// them deletes. Reading the known set off the struct tags means the list -// cannot drift from the struct, which it silently can today. +// The declared set comes from out's yaml tags, so adding a field to a struct is +// enough to stop it being collected as an extension. func decodeStructWithExtensions(node *yaml.Node, out any) (map[string]any, error) { if err := node.Decode(out); err != nil { return nil, err @@ -123,8 +106,7 @@ func decodeStructWithExtensions(node *yaml.Node, out any) (map[string]any, error // Origin.Key is not set here -- it is the location of the key heading this // mapping in its parent, which a node does not know. See setChildOriginKeys. func originFromNode(node *yaml.Node, file string) *Origin { - // Origins are opt-in. Without this every decode pays for them and every - // consumer sees positions it did not ask for. + // Origins are opt-in: without this every decode pays for them. if !originEnabledVar { return nil } @@ -162,12 +144,12 @@ func originFromNode(node *yaml.Node, file string) *Origin { } // setChildOriginKeys sets Origin.Key on the immediate children of a mapping, -// from the key node heading each one. This is the only origin data that cannot -// be read locally: UnmarshalYAML receives the value node, not the key above it. +// from the key node heading each one. // -// One field, one level. Children stamp their own children, so the tree is -// covered without anyone walking it -- unlike applyOrigins, which rebuilds the -// whole tree in parallel with a separately-built OriginTree. +// This is the only origin data a node cannot supply for itself: UnmarshalYAML +// receives the value node, and Key is the position of the key above it. Each +// child sets its own children's keys in turn, so one level per call covers the +// tree. func setChildOriginKeys(node *yaml.Node, container any, file string) { if !originEnabledVar { return @@ -193,15 +175,14 @@ func setChildOriginKeys(node *yaml.Node, container any, file string) { switch c := deref(child); c.Kind() { case reflect.Map: // A map-valued field (Content, Headers, Links) holds children of - // its own, each keyed in valNode. They are decoded by the generic - // map decoder, which has no hook to stamp them, so descend here. + // its own, keyed in valNode. The generic map decoder gives them no + // hook of their own, so descend. if c.CanInterface() { setChildOriginKeys(valNode, c.Interface(), file) } case reflect.Slice: // A sequence item has no key above it, so it takes its own first - // key as its Key -- the same choice the existing origin code makes - // ("in case of a sequence, we use the first element as the key"). + // key as its Key. if valNode.Kind != yaml.SequenceNode { continue } @@ -248,9 +229,8 @@ func childByKey(v reflect.Value, key string) reflect.Value { return reflect.Value{} } -// setOriginKey stamps Key on a child carrying an *Origin. Only the key's own -// position: the extent of what it heads is the consumer's to derive from the -// next boundary, which is what removes the need for a patched parser. +// setOriginKey stamps Key on a child carrying an *Origin, from the key's own +// position. The extent of what the key heads is the consumer's to derive. func setOriginKey(child reflect.Value, keyNode *yaml.Node, file string) { if !originEnabledVar { return @@ -278,22 +258,18 @@ func setOriginKey(child reflect.Value, keyNode *yaml.Node, file string) { Name: keyNode.Value, } // A $ref wrapper and the value it holds occupy the same node, so both - // carry that node's origin -- which is what applyOrigins produces today. + // carry that node's origin. if inner := child.FieldByName("Value"); inner.IsValid() { setOriginKey(inner, keyNode, file) } } -// stripTimestamps retags date-shaped scalars as strings. -// -// YAML 1.1 resolves an untagged scalar like 2020-06-11T16:32:50-03:00 to a -// timestamp, so an OpenAPI `example` of that shape decodes to a time.Time and -// then fails validation as an unhandled type. The previous decode path avoided -// this with a DisableTimestamps option on our yaml fork; stock go-yaml has no -// such option, so the same effect is had by retagging before decoding. +// stripTimestamps retags implicitly-resolved date-shaped scalars as strings. // -// Explicit !!timestamp tags in the source are left alone: those are a -// deliberate request for a time.Time, which is what the fork's option did too. +// YAML 1.1 resolves an untagged scalar such as 2020-06-11T16:32:50-03:00 to a +// timestamp, which would make an OpenAPI `example` of that shape decode to a +// time.Time and fail validation as an unhandled type. An explicit !!timestamp +// tag is a deliberate request for a time.Time and is left alone. func stripTimestamps(n *yaml.Node) { if n == nil { return diff --git a/openapi3/native_yaml_refs.go b/openapi3/native_yaml_refs.go index 6b69f0abe..24c46c0f9 100644 --- a/openapi3/native_yaml_refs.go +++ b/openapi3/native_yaml_refs.go @@ -1,10 +1,8 @@ package openapi3 -// UnmarshalYAML for the $ref wrappers. -// -// The JSON versions parse the same bytes up to four times -- once for the ref, -// once for the extra keys, once for a sibling schema, once for the value. -// Here each is read from the node that is already parsed. +// UnmarshalYAML for the $ref wrappers. A node holding a $ref carries the +// reference, and may carry summary, description and extensions alongside it; +// anything else is the value. import ( "strings" @@ -112,8 +110,9 @@ func (x *SecuritySchemeRef) UnmarshalYAML(node *yaml.Node) error { return node.Decode(&x.Value) } -// SchemaRef differs: no summary/description, and OAS 3.1 allows keyword -// siblings alongside a $ref, which are held until the reference resolves. +// SchemaRef takes no summary or description. OAS 3.1 allows schema keywords +// alongside a $ref, which are held on sibling until the reference resolves and +// they can be merged into the resolved value. func (x *SchemaRef) UnmarshalYAML(node *yaml.Node) error { x.Origin = originFromNode(node, nativeOriginFile()) if !unmarshalRefYAML(node, &x.Ref, nil, nil, &x.Extensions) { diff --git a/openapi3/native_yaml_shadow.go b/openapi3/native_yaml_shadow.go index 02216c0a2..8fcb20776 100644 --- a/openapi3/native_yaml_shadow.go +++ b/openapi3/native_yaml_shadow.go @@ -1,14 +1,8 @@ package openapi3 -// Generated companions to the UnmarshalJSON methods, decoding from the node -// instead of via JSON text. Each is the same three steps: decode into a shadow -// type, collect the keys the struct does not declare as extensions, and read -// the origin off the node. -// -// The JSON versions restate the known field set by hand as a list of deletes -// -- Schema's is about 60 lines of them -- which silently misfiles a field -// added to the struct and forgotten in the list. Here it comes off the struct -// tags and cannot drift. +// Generated. Each method is the same three steps: decode into a shadow type so +// the decoder does not recurse into this method, collect the keys the struct +// does not declare as extensions, and read the origin off the node. import ( yaml "go.yaml.in/yaml/v3" diff --git a/openapi3/native_yaml_special.go b/openapi3/native_yaml_special.go index 4b675071f..ab582805d 100644 --- a/openapi3/native_yaml_special.go +++ b/openapi3/native_yaml_special.go @@ -1,7 +1,7 @@ package openapi3 -// UnmarshalYAML for the maplike collections and the union-typed scalars, which -// do not follow the shadow-struct shape. +// UnmarshalYAML for the maplike collections, whose entries are components +// rather than declared fields, and for the union-typed values. import ( "reflect" @@ -10,10 +10,9 @@ import ( yaml "go.yaml.in/yaml/v3" ) -// unmarshalMaplikeYAML decodes a mapping whose entries are components and whose -// x- keys are extensions, stamping each entry's origin from the key that heads -// it. The JSON version re-marshals every entry back to JSON and re-parses it, -// once per entry; here the child node goes straight to the child decoder. +// unmarshalMaplikeYAML decodes a mapping whose x- keys are extensions and whose +// remaining entries are components, stamping each entry's origin from the key +// that heads it. func unmarshalMaplikeYAML[V any](node *yaml.Node, ext *map[string]any, out *map[string]*V) error { if node.Kind != yaml.MappingNode { return node.Decode(out) @@ -35,8 +34,7 @@ func unmarshalMaplikeYAML[V any](node *yaml.Node, ext *map[string]any, out *map[ return err } (*out)[k] = &vv - // This parent iterates, so it holds the key node and needs no - // reflection to stamp it. + // The key node is in hand here, so no reflection is needed to find it. setOriginKey(reflect.ValueOf(&vv), node.Content[i], nativeOriginFile()) } return nil @@ -69,7 +67,7 @@ func (paths *Paths) UnmarshalYAML(node *yaml.Node) error { return nil } -// Header embeds Parameter and defers to it, as the JSON version does. +// Header embeds Parameter and carries no fields of its own. func (header *Header) UnmarshalYAML(node *yaml.Node) error { return header.Parameter.UnmarshalYAML(node) } @@ -108,8 +106,8 @@ func (bs *BoolSchema) UnmarshalYAML(node *yaml.Node) error { return nil } -// ExclusiveBound is a bool in OAS 3.0 (a modifier for min/max) or a number in -// 3.1 (the bound itself). +// ExclusiveBound is a bool in OAS 3.0, where it modifies minimum/maximum, or a +// number in 3.1, where it is the bound itself. func (eb *ExclusiveBound) UnmarshalYAML(node *yaml.Node) error { if node.Kind != yaml.ScalarNode || node.Tag == "!!null" { return nil diff --git a/openapi3/native_yaml_test.go b/openapi3/native_yaml_test.go index 2ab416f44..f7249a2e5 100644 --- a/openapi3/native_yaml_test.go +++ b/openapi3/native_yaml_test.go @@ -24,8 +24,8 @@ const nativeSrc = `"200": x-collection: top ` -// Decoding from the node, on the stock parser, must produce the same document -// as the JSON round trip does. +// A document decoded from the node must equal the same document decoded as +// JSON: the two paths are interchangeable for content. func TestNativeStock_MatchesJSONPath(t *testing.T) { var viaJSON Responses jsonBytes, err := yamlToJSON(nativeSrc) @@ -42,10 +42,8 @@ func TestNativeStock_MatchesJSONPath(t *testing.T) { require.JSONEq(t, string(want), string(got)) } -// And the origins must match what the current path reconstructs -- except for -// end positions, which this design deliberately does not record. The extent of -// a block is derivable from the next boundary, which is what lets this run on -// an unpatched parser. +// Origins read from the node must match those reconstructed from an origin +// tree, on every field except end positions, which are not recorded. func TestNativeStock_OriginsMatchExceptEnds(t *testing.T) { defer func(v bool) { originEnabledVar = v }(originEnabledVar) originEnabledVar = true @@ -91,12 +89,11 @@ func TestNativeStock_OriginsMatchExceptEnds(t *testing.T) { } } - // End positions are absent by design: the stock parser does not record - // them and the consumer derives extents from the next boundary. + // End positions are not recorded; a consumer derives extents instead. require.Zero(t, got.Key.EndLine, "the stock parser records no end position") } -// The origin has to reach the nested media type, not just the top level. +// Origins must reach nested collections, not only the top level. func TestNativeStock_OriginsAtDepth(t *testing.T) { defer func(v bool) { originEnabledVar = v }(originEnabledVar) originEnabledVar = true diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalanceControlService_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalanceControlService_1_openapi_yaml__validate deleted file mode 100644 index e19288c10..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalanceControlService_1_openapi_yaml__validate +++ /dev/null @@ -1,10 +0,0 @@ -invalid paths: invalid path /balanceTransfer: invalid operation POST: invalid example: example post-balance-transfer: Error at "/createdAt": unhandled value of type time.Time -Schema: - { - "description": "The date when the balance transfer was requested.", - "format": "date-time", - "type": "string" - } - -Value: - "2022-01-24T14:59:11+01:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalancePlatformPaymentNotification_v1_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalancePlatformPaymentNotification_v1_1_openapi_yaml__validate deleted file mode 100644 index 4a96b2610..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalancePlatformPaymentNotification_v1_1_openapi_yaml__validate +++ /dev/null @@ -1,10 +0,0 @@ -invalid webhooks: webhook "balancePlatform.incomingTransfer.created": invalid operation POST: invalid example: example balancePlatform-incomingTransfer-created: Error at "/data/creationDate": unhandled value of type time.Time -Schema: - { - "description": "The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.", - "format": "date-time", - "type": "string" - } - -Value: - "2021-05-03T15:20:14+02:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalancePlatformReportNotification_v1_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalancePlatformReportNotification_v1_1_openapi_yaml__validate deleted file mode 100644 index 6536ab44e..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_BalancePlatformReportNotification_v1_1_openapi_yaml__validate +++ /dev/null @@ -1,10 +0,0 @@ -invalid webhooks: webhook "balancePlatform.report.created": invalid operation POST: invalid example: example balancePlatform.report.created: Error at "/data/creationDate": unhandled value of type time.Time -Schema: - { - "description": "The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.", - "format": "date-time", - "type": "string" - } - -Value: - "2021-07-02T02:01:08+02:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_37_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_37_openapi_yaml__load index 902879ef1..600b4ea6a 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_37_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_37_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 4971: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 4971: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_40_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_40_openapi_yaml__load index 01edf3ae1..62c48deaa 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_40_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_40_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5279: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5279: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_41_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_41_openapi_yaml__load index 6c4628c14..f0e607f51 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_41_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_41_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5364: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5364: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_46_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_46_openapi_yaml__load index 253010369..cd68be2ac 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_46_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_46_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5365: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5365: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_49_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_49_openapi_yaml__load index 279a03b98..8128eb958 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_49_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_49_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5375: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5375: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_50_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_50_openapi_yaml__load index 426e3b15b..906a6e29d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_50_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_50_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5433: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5433: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_51_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_51_openapi_yaml__load index 097ec6932..e969d9153 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_51_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_51_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5435: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5435: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_52_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_52_openapi_yaml__load index 6c1420bd4..a3a07f381 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_52_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_52_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5441: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5441: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_53_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_53_openapi_yaml__load index 6c1420bd4..a3a07f381 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_53_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_53_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5441: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5441: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_64_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_64_openapi_yaml__load index 6c1420bd4..a3a07f381 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_64_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_64_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5441: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5441: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_65_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_65_openapi_yaml__load index 4a31bfe54..b6763b9db 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_65_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_65_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5456: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5456: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_66_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_66_openapi_yaml__load index 4a31bfe54..b6763b9db 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_66_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_66_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5456: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5456: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_67_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_67_openapi_yaml__load index e6fe6ddef..8e2627520 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_67_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_67_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 5410: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 5410: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_68_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_68_openapi_yaml__load index c0210c8b9..7297a1030 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_68_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_68_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 4685: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 4685: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_69_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_69_openapi_yaml__load index c8c9e7e90..4d22dd9e4 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_69_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_69_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 4730: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 4730: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_70_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_70_openapi_yaml__load index a0b2b1c49..5a419976b 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_70_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_70_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 4776: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 4776: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_v71_71_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_v71_71_openapi_yaml__load index ba2850b0d..827845a98 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_v71_71_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_CheckoutService_v71_71_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 4772: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 4772: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_25_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_25_openapi_yaml__load index 67d2323f8..d0ddc2d76 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_25_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_25_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 964: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 964: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_30_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_30_openapi_yaml__load index 14aaec114..a54c3ace2 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_30_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_30_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1158: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1158: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_40_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_40_openapi_yaml__load index 238ecf375..41d00cc98 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_40_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_40_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1562: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1562: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_46_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_46_openapi_yaml__load index 238ecf375..41d00cc98 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_46_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_46_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1562: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1562: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_49_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_49_openapi_yaml__load index 238ecf375..41d00cc98 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_49_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_49_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1562: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1562: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_50_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_50_openapi_yaml__load index 9ff4f6619..5a583a987 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_50_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_50_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1575: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1575: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_51_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_51_openapi_yaml__load index 9cf7a1624..e4447e976 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_51_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_51_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1647: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1647: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_52_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_52_openapi_yaml__load index 9cf7a1624..e4447e976 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_52_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_52_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1647: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1647: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_64_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_64_openapi_yaml__load index 9cf7a1624..e4447e976 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_64_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_64_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1647: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1647: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_67_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_67_openapi_yaml__load index 9cf7a1624..e4447e976 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_67_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_67_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1647: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1647: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_68_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_68_openapi_yaml__load index a113cdfeb..508bf8a06 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_68_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PaymentService_68_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1808: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1808: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_30_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_30_openapi_yaml__validate deleted file mode 100644 index 03b5de802..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_30_openapi_yaml__validate +++ /dev/null @@ -1,11 +0,0 @@ -invalid paths: invalid path /storeDetail: invalid operation POST: invalid example: example storeDetail: Error at "/dateOfBirth": unhandled value of type time.Time -Schema: - { - "description": "The date of birth.\nFormat: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD\nFor Paysafecard it must be the same as used when registering the Paysafecard account.\n\u003e This field is mandatory for natural persons.", - "format": "date", - "type": "string", - "x-addedInVersion": "24" - } - -Value: - "1990-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_40_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_40_openapi_yaml__validate deleted file mode 100644 index 03b5de802..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_40_openapi_yaml__validate +++ /dev/null @@ -1,11 +0,0 @@ -invalid paths: invalid path /storeDetail: invalid operation POST: invalid example: example storeDetail: Error at "/dateOfBirth": unhandled value of type time.Time -Schema: - { - "description": "The date of birth.\nFormat: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD\nFor Paysafecard it must be the same as used when registering the Paysafecard account.\n\u003e This field is mandatory for natural persons.", - "format": "date", - "type": "string", - "x-addedInVersion": "24" - } - -Value: - "1990-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_46_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_46_openapi_yaml__load index 36ba354c8..325474a9d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_46_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_46_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 541: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 541: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_49_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_49_openapi_yaml__load index 36ba354c8..325474a9d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_49_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_49_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 541: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 541: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_50_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_50_openapi_yaml__validate deleted file mode 100644 index 03b5de802..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_50_openapi_yaml__validate +++ /dev/null @@ -1,11 +0,0 @@ -invalid paths: invalid path /storeDetail: invalid operation POST: invalid example: example storeDetail: Error at "/dateOfBirth": unhandled value of type time.Time -Schema: - { - "description": "The date of birth.\nFormat: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD\nFor Paysafecard it must be the same as used when registering the Paysafecard account.\n\u003e This field is mandatory for natural persons.", - "format": "date", - "type": "string", - "x-addedInVersion": "24" - } - -Value: - "1990-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_51_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_51_openapi_yaml__validate deleted file mode 100644 index 03b5de802..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_51_openapi_yaml__validate +++ /dev/null @@ -1,11 +0,0 @@ -invalid paths: invalid path /storeDetail: invalid operation POST: invalid example: example storeDetail: Error at "/dateOfBirth": unhandled value of type time.Time -Schema: - { - "description": "The date of birth.\nFormat: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD\nFor Paysafecard it must be the same as used when registering the Paysafecard account.\n\u003e This field is mandatory for natural persons.", - "format": "date", - "type": "string", - "x-addedInVersion": "24" - } - -Value: - "1990-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_52_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_52_openapi_yaml__validate deleted file mode 100644 index 03b5de802..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_52_openapi_yaml__validate +++ /dev/null @@ -1,11 +0,0 @@ -invalid paths: invalid path /storeDetail: invalid operation POST: invalid example: example storeDetail: Error at "/dateOfBirth": unhandled value of type time.Time -Schema: - { - "description": "The date of birth.\nFormat: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD\nFor Paysafecard it must be the same as used when registering the Paysafecard account.\n\u003e This field is mandatory for natural persons.", - "format": "date", - "type": "string", - "x-addedInVersion": "24" - } - -Value: - "1990-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_64_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_64_openapi_yaml__validate deleted file mode 100644 index 03b5de802..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_64_openapi_yaml__validate +++ /dev/null @@ -1,11 +0,0 @@ -invalid paths: invalid path /storeDetail: invalid operation POST: invalid example: example storeDetail: Error at "/dateOfBirth": unhandled value of type time.Time -Schema: - { - "description": "The date of birth.\nFormat: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD\nFor Paysafecard it must be the same as used when registering the Paysafecard account.\n\u003e This field is mandatory for natural persons.", - "format": "date", - "type": "string", - "x-addedInVersion": "24" - } - -Value: - "1990-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_67_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_67_openapi_yaml__validate deleted file mode 100644 index 03b5de802..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_67_openapi_yaml__validate +++ /dev/null @@ -1,11 +0,0 @@ -invalid paths: invalid path /storeDetail: invalid operation POST: invalid example: example storeDetail: Error at "/dateOfBirth": unhandled value of type time.Time -Schema: - { - "description": "The date of birth.\nFormat: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD\nFor Paysafecard it must be the same as used when registering the Paysafecard account.\n\u003e This field is mandatory for natural persons.", - "format": "date", - "type": "string", - "x-addedInVersion": "24" - } - -Value: - "1990-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_68_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_68_openapi_yaml__validate deleted file mode 100644 index 03b5de802..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_PayoutService_68_openapi_yaml__validate +++ /dev/null @@ -1,11 +0,0 @@ -invalid paths: invalid path /storeDetail: invalid operation POST: invalid example: example storeDetail: Error at "/dateOfBirth": unhandled value of type time.Time -Schema: - { - "description": "The date of birth.\nFormat: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD\nFor Paysafecard it must be the same as used when registering the Paysafecard account.\n\u003e This field is mandatory for natural persons.", - "format": "date", - "type": "string", - "x-addedInVersion": "24" - } - -Value: - "1990-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_25_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_25_openapi_yaml__validate deleted file mode 100644 index 9ab6e53b9..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_25_openapi_yaml__validate +++ /dev/null @@ -1,9 +0,0 @@ -invalid paths: invalid path /notifyShopper: invalid operation POST: invalid example: example notifyShopperOfUpcomingRecurringPayment: Error at "/billingDate": unhandled value of type time.Time -Schema: - { - "description": "Date on which the subscription amount will be debited from the shopper. In YYYY-MM-DD format", - "type": "string" - } - -Value: - "2021-03-16T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_30_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_30_openapi_yaml__validate deleted file mode 100644 index 9ab6e53b9..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_30_openapi_yaml__validate +++ /dev/null @@ -1,9 +0,0 @@ -invalid paths: invalid path /notifyShopper: invalid operation POST: invalid example: example notifyShopperOfUpcomingRecurringPayment: Error at "/billingDate": unhandled value of type time.Time -Schema: - { - "description": "Date on which the subscription amount will be debited from the shopper. In YYYY-MM-DD format", - "type": "string" - } - -Value: - "2021-03-16T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_40_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_40_openapi_yaml__validate deleted file mode 100644 index 9ab6e53b9..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_40_openapi_yaml__validate +++ /dev/null @@ -1,9 +0,0 @@ -invalid paths: invalid path /notifyShopper: invalid operation POST: invalid example: example notifyShopperOfUpcomingRecurringPayment: Error at "/billingDate": unhandled value of type time.Time -Schema: - { - "description": "Date on which the subscription amount will be debited from the shopper. In YYYY-MM-DD format", - "type": "string" - } - -Value: - "2021-03-16T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_49_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_49_openapi_yaml__validate deleted file mode 100644 index 9ab6e53b9..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_49_openapi_yaml__validate +++ /dev/null @@ -1,9 +0,0 @@ -invalid paths: invalid path /notifyShopper: invalid operation POST: invalid example: example notifyShopperOfUpcomingRecurringPayment: Error at "/billingDate": unhandled value of type time.Time -Schema: - { - "description": "Date on which the subscription amount will be debited from the shopper. In YYYY-MM-DD format", - "type": "string" - } - -Value: - "2021-03-16T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_67_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_67_openapi_yaml__validate deleted file mode 100644 index 9ab6e53b9..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_67_openapi_yaml__validate +++ /dev/null @@ -1,9 +0,0 @@ -invalid paths: invalid path /notifyShopper: invalid operation POST: invalid example: example notifyShopperOfUpcomingRecurringPayment: Error at "/billingDate": unhandled value of type time.Time -Schema: - { - "description": "Date on which the subscription amount will be debited from the shopper. In YYYY-MM-DD format", - "type": "string" - } - -Value: - "2021-03-16T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_68_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_68_openapi_yaml__validate deleted file mode 100644 index 9ab6e53b9..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_RecurringService_68_openapi_yaml__validate +++ /dev/null @@ -1,9 +0,0 @@ -invalid paths: invalid path /notifyShopper: invalid operation POST: invalid example: example notifyShopperOfUpcomingRecurringPayment: Error at "/billingDate": unhandled value of type time.Time -Schema: - { - "description": "Date on which the subscription amount will be debited from the shopper. In YYYY-MM-DD format", - "type": "string" - } - -Value: - "2021-03-16T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_2_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_2_openapi_yaml__validate deleted file mode 100644 index a6ea48ba4..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_2_openapi_yaml__validate +++ /dev/null @@ -1,99 +0,0 @@ -invalid paths: invalid path /transactions: invalid operation GET: invalid example: example success: Error at "/data/0/bookingDate": unhandled value of type time.Time -Schema: - { - "description": "The date the transaction was booked into the balance account.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2022-03-11T11:21:24+01:00" - | Error at "/data/0/createdAt": unhandled value of type time.Time -Schema: - { - "description": "The date the transaction was created.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2022-03-11T11:21:24+01:00" - | Error at "/data/0/valueDate": unhandled value of type time.Time -Schema: - { - "description": "The date the transfer amount becomes available in the balance account.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2022-03-11T11:21:24+01:00" - | Error at "/data/1/bookingDate": unhandled value of type time.Time -Schema: - { - "description": "The date the transaction was booked into the balance account.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2022-03-12T14:22:52+01:00" - | Error at "/data/1/createdAt": unhandled value of type time.Time -Schema: - { - "description": "The date the transaction was created.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2022-03-12T14:22:52+01:00" - | Error at "/data/1/valueDate": unhandled value of type time.Time -Schema: - { - "description": "The date the transfer amount becomes available in the balance account.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2022-03-12T14:22:52+01:00" - | Error at "/data/2/bookingDate": unhandled value of type time.Time -Schema: - { - "description": "The date the transaction was booked into the balance account.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2022-03-14T21:00:48+01:00" - | Error at "/data/2/createdAt": unhandled value of type time.Time -Schema: - { - "description": "The date the transaction was created.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2022-03-14T15:00:00+01:00" - | Error at "/data/2/valueDate": unhandled value of type time.Time -Schema: - { - "description": "The date the transfer amount becomes available in the balance account.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2022-03-14T21:00:48+01:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_3_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_3_openapi_yaml__validate deleted file mode 100644 index a6ea48ba4..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_3_openapi_yaml__validate +++ /dev/null @@ -1,99 +0,0 @@ -invalid paths: invalid path /transactions: invalid operation GET: invalid example: example success: Error at "/data/0/bookingDate": unhandled value of type time.Time -Schema: - { - "description": "The date the transaction was booked into the balance account.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2022-03-11T11:21:24+01:00" - | Error at "/data/0/createdAt": unhandled value of type time.Time -Schema: - { - "description": "The date the transaction was created.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2022-03-11T11:21:24+01:00" - | Error at "/data/0/valueDate": unhandled value of type time.Time -Schema: - { - "description": "The date the transfer amount becomes available in the balance account.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2022-03-11T11:21:24+01:00" - | Error at "/data/1/bookingDate": unhandled value of type time.Time -Schema: - { - "description": "The date the transaction was booked into the balance account.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2022-03-12T14:22:52+01:00" - | Error at "/data/1/createdAt": unhandled value of type time.Time -Schema: - { - "description": "The date the transaction was created.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2022-03-12T14:22:52+01:00" - | Error at "/data/1/valueDate": unhandled value of type time.Time -Schema: - { - "description": "The date the transfer amount becomes available in the balance account.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2022-03-12T14:22:52+01:00" - | Error at "/data/2/bookingDate": unhandled value of type time.Time -Schema: - { - "description": "The date the transaction was booked into the balance account.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2022-03-14T21:00:48+01:00" - | Error at "/data/2/createdAt": unhandled value of type time.Time -Schema: - { - "description": "The date the transaction was created.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2022-03-14T15:00:00+01:00" - | Error at "/data/2/valueDate": unhandled value of type time.Time -Schema: - { - "description": "The date the transfer amount becomes available in the balance account.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2022-03-14T21:00:48+01:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_v4_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_v4_4_openapi_yaml__validate deleted file mode 100644 index 94c9d5c6c..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/adyen_com_TransferService_v4_4_openapi_yaml__validate +++ /dev/null @@ -1,128 +0,0 @@ -invalid paths: invalid path /transactions: invalid operation GET: invalid example: example success: Error at "/data/0/bookingDate": unhandled value of type time.Time -Schema: - { - "description": "The date the transaction was booked into the balance account.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2023-08-10T14:51:33+02:00" - | Error at "/data/0/creationDate": unhandled value of type time.Time -Schema: - { - "description": "The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.", - "format": "date-time", - "type": "string" - } - -Value: - "2023-08-10T14:51:20+02:00" - | Error at "/data/0/valueDate": unhandled value of type time.Time -Schema: - { - "description": "The date the transfer amount becomes available in the balance account.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2023-08-10T14:51:20+02:00" - | Error at "/data/1/bookingDate": unhandled value of type time.Time -Schema: - { - "description": "The date the transaction was booked into the balance account.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2023-08-10T15:34:40+02:00" - | Error at "/data/1/creationDate": unhandled value of type time.Time -Schema: - { - "description": "The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.", - "format": "date-time", - "type": "string" - } - -Value: - "2023-08-10T15:34:31+02:00" - | Error at "/data/1/valueDate": unhandled value of type time.Time -Schema: - { - "description": "The date the transfer amount becomes available in the balance account.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2023-08-10T15:34:31+02:00" - | Error at "/data/2/bookingDate": unhandled value of type time.Time -Schema: - { - "description": "The date the transaction was booked into the balance account.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2023-08-11T13:45:57+02:00" - | Error at "/data/2/creationDate": unhandled value of type time.Time -Schema: - { - "description": "The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.", - "format": "date-time", - "type": "string" - } - -Value: - "2023-08-11T13:45:46+02:00" - | Error at "/data/2/valueDate": unhandled value of type time.Time -Schema: - { - "description": "The date the transfer amount becomes available in the balance account.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2023-08-11T13:45:46+02:00" - | Error at "/data/3/bookingDate": unhandled value of type time.Time -Schema: - { - "description": "The date the transaction was booked into the balance account.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2023-08-11T13:45:58+02:00" - | Error at "/data/3/creationDate": unhandled value of type time.Time -Schema: - { - "description": "The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.", - "format": "date-time", - "type": "string" - } - -Value: - "2023-08-11T13:45:51+02:00" - | Error at "/data/3/valueDate": unhandled value of type time.Time -Schema: - { - "description": "The date the transfer amount becomes available in the balance account.", - "format": "date-time", - "type": "string", - "x-addedInVersion": "1" - } - -Value: - "2023-08-11T13:45:51+02:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_amadeus_trip_parser_3_0_1_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_amadeus_trip_parser_3_0_1_openapi_yaml__load index 10b861a73..9600eeaf7 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_amadeus_trip_parser_3_0_1_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/amadeus_com_amadeus_trip_parser_3_0_1_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 275: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 275: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_ats_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_ats_10_0_0_openapi_yaml__validate deleted file mode 100644 index 253cdce02..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_ats_10_0_0_openapi_yaml__validate +++ /dev/null @@ -1,13 +0,0 @@ -invalid components: schema "Applicant": invalid example: unhandled value of type time.Time -Schema: - { - "description": "The date of birth of the person.", - "example": "2000-08-12T00:00:00Z", - "format": "date", - "nullable": true, - "title": "Birth Date", - "type": "string" - } - -Value: - "2000-08-12T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_crm_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_crm_10_0_0_openapi_yaml__validate deleted file mode 100644 index 3312ae9cc..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_crm_10_0_0_openapi_yaml__validate +++ /dev/null @@ -1,11 +0,0 @@ -invalid components: schema "ActivitiesFilter": invalid example: unhandled value of type time.Time -Schema: - { - "example": "2020-09-30T07:43:32Z", - "format": "date-time", - "title": "Updated since (timestamp)", - "type": "string" - } - -Value: - "2020-09-30T07:43:32Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_customer_support_9_5_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_customer_support_9_5_0_openapi_yaml__validate deleted file mode 100644 index d0ec9e7c7..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_customer_support_9_5_0_openapi_yaml__validate +++ /dev/null @@ -1,13 +0,0 @@ -invalid components: schema "Company": invalid example: unhandled value of type time.Time -Schema: - { - "description": "The date of birth of the person.", - "example": "2000-08-12T00:00:00Z", - "format": "date", - "nullable": true, - "title": "Birth Date", - "type": "string" - } - -Value: - "2000-08-12T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_ecommerce_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_ecommerce_10_0_0_openapi_yaml__validate deleted file mode 100644 index 505169060..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_ecommerce_10_0_0_openapi_yaml__validate +++ /dev/null @@ -1,14 +0,0 @@ -invalid components: schema "CreatedAt": invalid example: unhandled value of type time.Time -Schema: - { - "description": "The date and time when the object was created.", - "example": "2020-09-30T07:43:32Z", - "format": "date-time", - "nullable": true, - "readOnly": true, - "title": "Created at (timestamp)", - "type": "string" - } - -Value: - "2020-09-30T07:43:32Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_file_storage_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_file_storage_10_0_0_openapi_yaml__validate deleted file mode 100644 index 505169060..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_file_storage_10_0_0_openapi_yaml__validate +++ /dev/null @@ -1,14 +0,0 @@ -invalid components: schema "CreatedAt": invalid example: unhandled value of type time.Time -Schema: - { - "description": "The date and time when the object was created.", - "example": "2020-09-30T07:43:32Z", - "format": "date-time", - "nullable": true, - "readOnly": true, - "title": "Created at (timestamp)", - "type": "string" - } - -Value: - "2020-09-30T07:43:32Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_issue_tracking_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_issue_tracking_10_0_0_openapi_yaml__validate deleted file mode 100644 index 001804c22..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_issue_tracking_10_0_0_openapi_yaml__validate +++ /dev/null @@ -1,14 +0,0 @@ -invalid components: schema "Collection": invalid example: unhandled value of type time.Time -Schema: - { - "description": "The date and time when the object was created.", - "example": "2020-09-30T07:43:32Z", - "format": "date-time", - "nullable": true, - "readOnly": true, - "title": "Created at (timestamp)", - "type": "string" - } - -Value: - "2020-09-30T07:43:32Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_lead_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_lead_10_0_0_openapi_yaml__validate deleted file mode 100644 index b0ee036a2..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_lead_10_0_0_openapi_yaml__validate +++ /dev/null @@ -1,13 +0,0 @@ -invalid components: schema "GetLeadResponse": invalid example: unhandled value of type time.Time -Schema: - { - "description": "Date created in ISO 8601 format", - "example": "2020-09-30T07:43:32Z", - "nullable": true, - "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$", - "readOnly": true, - "type": "string" - } - -Value: - "2020-09-30T07:43:32Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_sms_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_sms_10_0_0_openapi_yaml__validate deleted file mode 100644 index 647cc12e8..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_sms_10_0_0_openapi_yaml__validate +++ /dev/null @@ -1,14 +0,0 @@ -invalid components: schema "GetMessageResponse": invalid example: unhandled value of type time.Time -Schema: - { - "description": "The date and time when the object was created.", - "example": "2020-09-30T07:43:32Z", - "format": "date-time", - "nullable": true, - "readOnly": true, - "title": "Created at (timestamp)", - "type": "string" - } - -Value: - "2020-09-30T07:43:32Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_vault_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_vault_10_0_0_openapi_yaml__validate deleted file mode 100644 index 6fa12a1df..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_vault_10_0_0_openapi_yaml__validate +++ /dev/null @@ -1,10 +0,0 @@ -invalid components: schema "Connection": invalid example: unhandled value of type time.Time -Schema: - { - "description": "The date and time the webhook subscription was created downstream", - "example": "2020-10-01T12:00:00Z", - "type": "string" - } - -Value: - "2020-10-01T12:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_webhook_10_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/apideck_com_webhook_10_0_0_openapi_yaml__validate deleted file mode 100644 index 54fbf86d5..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/apideck_com_webhook_10_0_0_openapi_yaml__validate +++ /dev/null @@ -1,14 +0,0 @@ -invalid components: schema "CreateWebhookResponse": invalid example: unhandled value of type time.Time -Schema: - { - "description": "The date and time when the object was created.", - "example": "2020-09-30T07:43:32Z", - "format": "date-time", - "nullable": true, - "readOnly": true, - "title": "Created at (timestamp)", - "type": "string" - } - -Value: - "2020-09-30T07:43:32Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/archive_org_wayback_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/archive_org_wayback_1_0_0_openapi_yaml__validate deleted file mode 100644 index 0c86a77ff..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/archive_org_wayback_1_0_0_openapi_yaml__validate +++ /dev/null @@ -1,18 +0,0 @@ -invalid components: schema "AvailabilityRequests": invalid example: Error at "/0/timestamp": unhandled value of type time.Time -Schema: - { - "description": "Timestamp requested in ISO 8601 format. The following formats are acceptable: - YYYY - YYYY-MM - YYYY-MM-DD - YYYY-MM-DDTHH:mm:SSz - YYYY-MM-DD:HH:mm+00:00\n", - "type": "string" - } - -Value: - "2016-04-07T19:39:18Z" - | Error at "/2/timestamp": unhandled value of type time.Time -Schema: - { - "description": "Timestamp requested in ISO 8601 format. The following formats are acceptable: - YYYY - YYYY-MM - YYYY-MM-DD - YYYY-MM-DDTHH:mm:SSz - YYYY-MM-DD:HH:mm+00:00\n", - "type": "string" - } - -Value: - "2016-04-07T19:39:18Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/braze_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/braze_com_1_0_0_openapi_yaml__validate deleted file mode 100644 index da2fa6d1e..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/braze_com_1_0_0_openapi_yaml__validate +++ /dev/null @@ -1,9 +0,0 @@ -invalid paths: invalid path /email/hard_bounces: invalid operation GET: parameter "start_date" schema is invalid: invalid example: unhandled value of type time.Time -Schema: - { - "example": "2019-01-01T00:00:00Z", - "type": "string" - } - -Value: - "2019-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/bunq_com_1_0_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/bunq_com_1_0_openapi_yaml__load index d065d5a33..44519b11a 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/bunq_com_1_0_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/bunq_com_1_0_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 1142: did not find expected key +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 1142: did not find expected key diff --git a/openapi3/testdata/apis_guru_openapi_directory/canada_holidays_ca_1_8_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/canada_holidays_ca_1_8_0_openapi_yaml__validate deleted file mode 100644 index 8ebc85807..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/canada_holidays_ca_1_8_0_openapi_yaml__validate +++ /dev/null @@ -1,11 +0,0 @@ -invalid components: schema "Error": invalid example: unhandled value of type time.Time -Schema: - { - "description": "A UTC ISO timestamp", - "example": "2020-04-27T05:41:10.71Z", - "format": "date-time", - "type": "string" - } - -Value: - "2020-04-27T05:41:10.71Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/chain49_com_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/chain49_com_2_0_openapi_yaml__validate deleted file mode 100644 index f54298396..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/chain49_com_2_0_openapi_yaml__validate +++ /dev/null @@ -1,40 +0,0 @@ -invalid paths: invalid path /{blockchain}: invalid operation GET: invalid example: example Example 1: Error at "/blockbook/buildTime": unhandled value of type time.Time -Schema: - { - "type": "string" - } - -Value: - "2023-02-27T02:40:48Z" - | Error at "/blockbook/currentFiatRatesTime": unhandled value of type time.Time -Schema: - { - "type": "string" - } - -Value: - "2023-04-07T03:00:04.080770962Z" - | Error at "/blockbook/historicalFiatRatesTime": unhandled value of type time.Time -Schema: - { - "type": "string" - } - -Value: - "2023-04-07T00:00:00Z" - | Error at "/blockbook/lastBlockTime": unhandled value of type time.Time -Schema: - { - "type": "string" - } - -Value: - "2023-04-07T02:55:40.032567054Z" - | Error at "/blockbook/lastMempoolTime": unhandled value of type time.Time -Schema: - { - "type": "string" - } - -Value: - "2023-04-07T03:04:36.260327616Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/chaingateway_io_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/chaingateway_io_1_0_0_openapi_yaml__validate deleted file mode 100644 index 15ef2ecde..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/chaingateway_io_1_0_0_openapi_yaml__validate +++ /dev/null @@ -1,9 +0,0 @@ -invalid paths: invalid path /v2/bitcoin/webhooks/notifications/failed: invalid operation GET: invalid example: unhandled value of type time.Time -Schema: - { - "example": "2020-09-19T14:33:01Z", - "type": "string" - } - -Value: - "2020-09-19T14:33:01Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/chaingateway_io_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/chaingateway_io_1_0_openapi_yaml__validate deleted file mode 100644 index d4d5b31a2..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/chaingateway_io_1_0_openapi_yaml__validate +++ /dev/null @@ -1,8 +0,0 @@ -invalid components: schema "FailedIpn": invalid example: Error at "/timestamp": unhandled value of type time.Time -Schema: - { - "type": "string" - } - -Value: - "2020-09-19T14:33:01Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/codat_io_accounting_2_1_0_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/codat_io_accounting_2_1_0_openapi_yaml__load index 711e7ca6c..429dfa06b 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/codat_io_accounting_2_1_0_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/codat_io_accounting_2_1_0_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: line 43981: found a tab character where an indentation space is expected +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: line 43981: found a tab character where an indentation space is expected diff --git a/openapi3/testdata/apis_guru_openapi_directory/codat_io_assess_1_0_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/codat_io_assess_1_0_openapi_yaml__load index 7f6544a0b..11379f886 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/codat_io_assess_1_0_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/codat_io_assess_1_0_openapi_yaml__load @@ -1 +1,2 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal object into field Schema.examples of type []interface {} +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: unmarshal errors: + line 4692: cannot unmarshal !!map into []interface {} diff --git a/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_commerce_1_1_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_commerce_1_1_openapi_yaml__load index 2a6522f53..c34de6b50 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_commerce_1_1_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_commerce_1_1_openapi_yaml__load @@ -1 +1,2 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal bool into field Schema.properties of type openapi3.Schema +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: unmarshal errors: + line 751: cannot unmarshal !!bool `false` into openapi3.SchemaBis diff --git a/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_expenses_prealpha_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_expenses_prealpha_openapi_yaml__load index 2a6522f53..846fbcea7 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_expenses_prealpha_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_expenses_prealpha_openapi_yaml__load @@ -1 +1,2 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal bool into field Schema.properties of type openapi3.Schema +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: unmarshal errors: + line 766: cannot unmarshal !!bool `false` into openapi3.SchemaBis diff --git a/openapi3/testdata/apis_guru_openapi_directory/currencytick_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/currencytick_com_1_0_0_openapi_yaml__validate deleted file mode 100644 index d205c4f37..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/currencytick_com_1_0_0_openapi_yaml__validate +++ /dev/null @@ -1,10 +0,0 @@ -invalid paths: invalid path /historical: invalid operation GET: parameter "date" schema is invalid: invalid example: unhandled value of type time.Time -Schema: - { - "description": "The date to get the exchange rate.", - "example": "2023-04-18T00:00:00Z", - "type": "string" - } - -Value: - "2023-04-18T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/docusign_net_v2_1_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/docusign_net_v2_1_openapi_yaml__load index e5fb18fb8..f6be00efb 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/docusign_net_v2_1_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/docusign_net_v2_1_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: control characters are not allowed +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: control characters are not allowed diff --git a/openapi3/testdata/apis_guru_openapi_directory/formapi_io_v1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/formapi_io_v1_openapi_yaml__validate deleted file mode 100644 index 616cd4562..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/formapi_io_v1_openapi_yaml__validate +++ /dev/null @@ -1,9 +0,0 @@ -invalid paths: invalid path /combined_submissions: invalid operation GET: invalid example: example response: Error at "/3/expires_at": unhandled value of type time.Time -Schema: - { - "nullable": true, - "type": "string" - } - -Value: - "2023-01-05T14:05:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/getpostman_com_1_20_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/getpostman_com_1_20_0_openapi_yaml__validate deleted file mode 100644 index 31d6bb3d6..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/getpostman_com_1_20_0_openapi_yaml__validate +++ /dev/null @@ -1,9 +0,0 @@ -invalid paths: invalid path /apis: invalid operation POST: invalid example: unhandled value of type time.Time -Schema: - { - "example": "2019-02-12T19:34:49Z", - "type": "string" - } - -Value: - "2019-02-12T19:34:49Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/groundhog_day_com_1_2_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/groundhog_day_com_1_2_1_openapi_yaml__validate deleted file mode 100644 index cee224041..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/groundhog_day_com_1_2_1_openapi_yaml__validate +++ /dev/null @@ -1,8 +0,0 @@ -invalid paths: invalid path /api/v1/groundhogs/{slug}: invalid operation GET: invalid example: example /groundhogs/punxsutawney-paul: Error at "/error/timestamp": unhandled value of type time.Time -Schema: - { - "type": "string" - } - -Value: - "2022-10-03T03:37:51.567Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/hubapi_com_communication_preferences_v3_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/hubapi_com_communication_preferences_v3_openapi_yaml__validate deleted file mode 100644 index 1d5a20e9e..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/hubapi_com_communication_preferences_v3_openapi_yaml__validate +++ /dev/null @@ -1,60 +0,0 @@ -invalid paths: invalid path /communication-preferences/v3/definitions: invalid operation GET: invalid example: Error at "/subscriptionDefinitions/0/createdAt": unhandled value of type time.Time -Schema: - { - "description": "Time at which the definition was created.", - "format": "date-time", - "type": "string" - } - -Value: - "2019-08-05T13:01:15.875Z" - | Error at "/subscriptionDefinitions/0/updatedAt": unhandled value of type time.Time -Schema: - { - "description": "Time at which the definition was last updated.", - "format": "date-time", - "type": "string" - } - -Value: - "2019-08-05T13:01:15.875Z" - | Error at "/subscriptionDefinitions/1/createdAt": unhandled value of type time.Time -Schema: - { - "description": "Time at which the definition was created.", - "format": "date-time", - "type": "string" - } - -Value: - "2019-08-05T13:01:15.875Z" - | Error at "/subscriptionDefinitions/1/updatedAt": unhandled value of type time.Time -Schema: - { - "description": "Time at which the definition was last updated.", - "format": "date-time", - "type": "string" - } - -Value: - "2019-08-05T13:01:15.875Z" - | Error at "/subscriptionDefinitions/2/createdAt": unhandled value of type time.Time -Schema: - { - "description": "Time at which the definition was created.", - "format": "date-time", - "type": "string" - } - -Value: - "2019-08-05T13:01:15.875Z" - | Error at "/subscriptionDefinitions/2/updatedAt": unhandled value of type time.Time -Schema: - { - "description": "Time at which the definition was last updated.", - "format": "date-time", - "type": "string" - } - -Value: - "2019-08-05T13:01:15.875Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/hubapi_com_webhooks_v3_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/hubapi_com_webhooks_v3_openapi_yaml__validate deleted file mode 100644 index 770ecc664..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/hubapi_com_webhooks_v3_openapi_yaml__validate +++ /dev/null @@ -1,20 +0,0 @@ -invalid components: schema "SettingsResponse": invalid example: Error at "/createdAt": unhandled value of type time.Time -Schema: - { - "description": "When this subscription was created. Formatted as milliseconds from the [Unix epoch](#).", - "format": "date-time", - "type": "string" - } - -Value: - "2020-01-24T16:27:59Z" - | Error at "/updatedAt": unhandled value of type time.Time -Schema: - { - "description": "When this subscription was last updated. Formatted as milliseconds from the [Unix epoch](#).", - "format": "date-time", - "type": "string" - } - -Value: - "2020-01-24T16:32:43Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/icons8_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/icons8_com_1_0_0_openapi_yaml__validate deleted file mode 100644 index ba6c9064e..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/icons8_com_1_0_0_openapi_yaml__validate +++ /dev/null @@ -1,8 +0,0 @@ -invalid paths: invalid path /api/iconsets/v3/total?since={since}: invalid operation GET: invalid example: unhandled value of type time.Time -Schema: - { - "type": "string" - } - -Value: - "2014-12-31T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/impala_travel_hotels_1_003_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/impala_travel_hotels_1_003_openapi_yaml__validate deleted file mode 100644 index 9106bc381..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/impala_travel_hotels_1_003_openapi_yaml__validate +++ /dev/null @@ -1,9 +0,0 @@ -invalid components: schema "adjustmentConditionLengthOfStayRule": invalid example: unhandled value of type time.Time -Schema: - { - "example": "2021-08-23T00:00:00Z", - "type": "string" - } - -Value: - "2021-08-23T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/ipqualityscore_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/ipqualityscore_com_1_0_0_openapi_yaml__validate deleted file mode 100644 index 70f9f73f2..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/ipqualityscore_com_1_0_0_openapi_yaml__validate +++ /dev/null @@ -1,9 +0,0 @@ -invalid paths: invalid path /json/email/{YOUR_API_KEY_HERE}/{USER_EMAIL_HERE}: invalid operation GET: invalid example: unhandled value of type time.Time -Schema: - { - "example": "2013-09-10T14:18:53-04:00", - "type": "string" - } - -Value: - "2013-09-10T14:18:53-04:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/klarna_com_payments_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/klarna_com_payments_1_0_0_openapi_yaml__validate deleted file mode 100644 index ac01c0ed3..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/klarna_com_payments_1_0_0_openapi_yaml__validate +++ /dev/null @@ -1,10 +0,0 @@ -invalid components: schema "create_order_request": invalid example: unhandled value of type time.Time -Schema: - { - "description": "Customer’s date of birth. The format is ‘yyyy-mm-dd’", - "example": "1978-12-31T00:00:00Z", - "type": "string" - } - -Value: - "1978-12-31T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/meraki_com_1_32_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/meraki_com_1_32_0_openapi_yaml__validate deleted file mode 100644 index be9688a9d..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/meraki_com_1_32_0_openapi_yaml__validate +++ /dev/null @@ -1,10 +0,0 @@ -invalid paths: invalid path /administered/identities/me: invalid operation GET: invalid example: example response: Error at "/lastUsedDashboardAt": unhandled value of type time.Time -Schema: - { - "description": "Last seen active on Dashboard UI", - "format": "date-time", - "type": "string" - } - -Value: - "2018-02-11T00:00:00.09021Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_1_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_1_1_openapi_yaml__validate deleted file mode 100644 index d317e1a5f..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_1_1_openapi_yaml__validate +++ /dev/null @@ -1,10 +0,0 @@ -invalid paths: invalid path /{projectId}/image: invalid operation POST: invalid example: example Successful Prediction with Image request: Error at "/Created": unhandled value of type time.Time -Schema: - { - "format": "date-time", - "readOnly": true, - "type": "string" - } - -Value: - "2017-12-19T14:21:41.6789561Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_2_0_openapi_yaml__validate deleted file mode 100644 index 93a4029d1..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Prediction_2_0_openapi_yaml__validate +++ /dev/null @@ -1,10 +0,0 @@ -invalid paths: invalid path /{projectId}/image: invalid operation POST: invalid example: example Successful PredictImage request: Error at "/created": unhandled value of type time.Time -Schema: - { - "format": "date-time", - "readOnly": true, - "type": "string" - } - -Value: - "2017-12-19T14:21:41.6789561Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_1_2_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_1_2_openapi_yaml__validate deleted file mode 100644 index cea3fedca..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/microsoft_com_cognitiveservices_Training_1_2_openapi_yaml__validate +++ /dev/null @@ -1,22 +0,0 @@ -invalid paths: invalid path /projects: invalid operation GET: invalid example: example Successful GetProjects request: Error at "/0/Created": unhandled value of type time.Time -Schema: - { - "description": "Gets the date this project was created", - "format": "date-time", - "readOnly": true, - "type": "string" - } - -Value: - "2017-12-18T05:43:18.08Z" - | Error at "/0/LastModified": unhandled value of type time.Time -Schema: - { - "description": "Gets the date this project was last modified", - "format": "date-time", - "readOnly": true, - "type": "string" - } - -Value: - "2017-12-18T05:43:18.0962423Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/mux_com_v1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/mux_com_v1_openapi_yaml__validate deleted file mode 100644 index 4f508d87d..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/mux_com_v1_openapi_yaml__validate +++ /dev/null @@ -1,9 +0,0 @@ -invalid paths: invalid path /data/v1/errors: invalid operation GET: invalid example: Error at "/data/0/last_seen": unhandled value of type time.Time -Schema: - { - "description": "The last time this error was seen (ISO 8601 timestamp).", - "type": "string" - } - -Value: - "2021-01-08T13:42:39Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/neutrinoapi_net_3_6_4_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/neutrinoapi_net_3_6_4_openapi_yaml__validate deleted file mode 100644 index b1348778f..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/neutrinoapi_net_3_6_4_openapi_yaml__validate +++ /dev/null @@ -1,10 +0,0 @@ -invalid components: schema "GeocodeAddressResponse": invalid example: unhandled value of type time.Time -Schema: - { - "description": "The current date at the time zone (ISO 8601 format 'YYYY-MM-DD')", - "example": "2021-01-01T00:00:00Z", - "type": "string" - } - -Value: - "2021-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversion_1_0_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversion_1_0_1_openapi_yaml__validate deleted file mode 100644 index 870643a5e..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_conversion_1_0_1_openapi_yaml__validate +++ /dev/null @@ -1,8 +0,0 @@ -invalid components: parameter "timestamp": invalid example: unhandled value of type time.Time -Schema: - { - "type": "string" - } - -Value: - "2020-01-01T12:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_media_1_0_2_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_media_1_0_2_openapi_yaml__validate deleted file mode 100644 index 77e09bd8a..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_media_1_0_2_openapi_yaml__validate +++ /dev/null @@ -1,10 +0,0 @@ -invalid components: schema "Media": invalid example: unhandled value of type time.Time -Schema: - { - "description": "A timestamp for the time that the file was created", - "example": "2020-01-01T14:00:00Z", - "type": "string" - } - -Value: - "2020-01-01T14:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_sms_1_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_sms_1_2_0_openapi_yaml__validate deleted file mode 100644 index d93718a10..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_sms_1_2_0_openapi_yaml__validate +++ /dev/null @@ -1,10 +0,0 @@ -invalid components: schema "DeliveryReceipt": invalid example: unhandled value of type time.Time -Schema: - { - "description": "The time when Vonage started to push this Delivery Receipt to your webhook endpoint.", - "example": "2020-01-01T12:00:00Z", - "type": "string" - } - -Value: - "2020-01-01T12:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/nowpayments_io_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nowpayments_io_1_0_0_openapi_yaml__validate deleted file mode 100644 index d3b3c3817..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/nowpayments_io_1_0_0_openapi_yaml__validate +++ /dev/null @@ -1,9 +0,0 @@ -invalid paths: invalid path /v1/payment/: invalid operation GET: parameter "dateFrom" schema is invalid: invalid example: unhandled value of type time.Time -Schema: - { - "example": "2020-01-01T00:00:00Z", - "type": "string" - } - -Value: - "2020-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/ntropy_network_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/ntropy_network_1_0_0_openapi_yaml__validate deleted file mode 100644 index 3956eec54..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/ntropy_network_1_0_0_openapi_yaml__validate +++ /dev/null @@ -1,9 +0,0 @@ -invalid paths: invalid path /classifier/business/batch/{id}: invalid operation GET: invalid example: unhandled value of type time.Time -Schema: - { - "example": "1949-08-24T23:09:35.824Z", - "type": "string" - } - -Value: - "1949-08-24T23:09:35.824Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/nytimes_com_books_api_3_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nytimes_com_books_api_3_0_0_openapi_yaml__validate deleted file mode 100644 index c308c3aeb..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/nytimes_com_books_api_3_0_0_openapi_yaml__validate +++ /dev/null @@ -1,24 +0,0 @@ -invalid paths: invalid path /lists.{format}: invalid operation GET: invalid example: example response: Error at "/last_modified": unhandled value of type time.Time -Schema: - { - "type": "string" - } - -Value: - "2016-03-11T13:09:01-05:00" - | Error at "/results/0/bestsellers_date": unhandled value of type time.Time -Schema: - { - "type": "string" - } - -Value: - "2016-03-05T00:00:00Z" - | Error at "/results/0/published_date": unhandled value of type time.Time -Schema: - { - "type": "string" - } - -Value: - "2016-03-20T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/openaq_local_2_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/openaq_local_2_0_0_openapi_yaml__validate deleted file mode 100644 index 0d6891a0a..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/openaq_local_2_0_0_openapi_yaml__validate +++ /dev/null @@ -1,19 +0,0 @@ -invalid paths: invalid path /v1/measurements: invalid operation GET: parameter "date_from" schema is invalid: invalid default: doesn't match any schema from "anyOf" -Schema: - { - "anyOf": [ - { - "format": "date-time", - "type": "string" - }, - { - "format": "date", - "type": "string" - } - ], - "default": "2000-01-01T00:00:00Z", - "title": "Date From" - } - -Value: - "2000-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/openstates_org_2021_11_12_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/openstates_org_2021_11_12_openapi_yaml__validate deleted file mode 100644 index 651eb1156..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/openstates_org_2021_11_12_openapi_yaml__validate +++ /dev/null @@ -1,10 +0,0 @@ -invalid components: schema "Bill": invalid example: unhandled value of type time.Time -Schema: - { - "example": "2020-03-14T00:00:00Z", - "title": "Date", - "type": "string" - } - -Value: - "2020-03-14T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/phantauth_net_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/phantauth_net_1_0_0_openapi_yaml__validate deleted file mode 100644 index acdaa653f..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/phantauth_net_1_0_0_openapi_yaml__validate +++ /dev/null @@ -1,9 +0,0 @@ -invalid paths: invalid path /user: invalid operation POST: invalid example: Error at "/birthdate": unhandled value of type time.Time -Schema: - { - "description": "The user's birthday, represented as an ISO 8601:2004 [ISO8601‑2004] YYYY-MM-DD format.", - "type": "string" - } - -Value: - "1950-02-10T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/proxykingdom_com_v1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/proxykingdom_com_v1_openapi_yaml__validate deleted file mode 100644 index 50379dcb8..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/proxykingdom_com_v1_openapi_yaml__validate +++ /dev/null @@ -1,10 +0,0 @@ -invalid paths: invalid path /proxy: invalid operation GET: invalid example: Error at "/lastTested": unhandled value of type time.Time -Schema: - { - "nullable": true, - "readOnly": true, - "type": "string" - } - -Value: - "2023-04-23T08:56:13Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/prss_org_2_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/prss_org_2_0_0_openapi_yaml__validate deleted file mode 100644 index 4954d662d..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/prss_org_2_0_0_openapi_yaml__validate +++ /dev/null @@ -1,11 +0,0 @@ -invalid components: schema "SpotInsertion": invalid example: unhandled value of type time.Time -Schema: - { - "description": "The date the spot insertion ends. The time will be set to midnight Eastern Time.", - "example": "2020-01-31T00:00:00Z", - "format": "date", - "type": "string" - } - -Value: - "2020-01-31T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/qualtrics_com_0_2_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/qualtrics_com_0_2_openapi_yaml__validate deleted file mode 100644 index 880d2d76c..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/qualtrics_com_0_2_openapi_yaml__validate +++ /dev/null @@ -1,9 +0,0 @@ -invalid components: schema "CreateDistributionLinks": invalid example: unhandled value of type time.Time -Schema: - { - "example": "2021-01-21T00:00:00Z", - "type": "string" - } - -Value: - "2021-01-21T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/rapidapi_com_ecowetter_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/rapidapi_com_ecowetter_1_0_0_openapi_yaml__validate deleted file mode 100644 index d744cc2d3..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/rapidapi_com_ecowetter_1_0_0_openapi_yaml__validate +++ /dev/null @@ -1,8 +0,0 @@ -invalid paths: invalid path /public/history: invalid operation GET: invalid example: unhandled value of type time.Time -Schema: - { - "type": "string" - } - -Value: - "2021-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/sendgrid_com_1_0_0_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/sendgrid_com_1_0_0_openapi_yaml__load index e5fb18fb8..f6be00efb 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/sendgrid_com_1_0_0_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/sendgrid_com_1_0_0_openapi_yaml__load @@ -1 +1 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: control characters are not allowed +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: control characters are not allowed diff --git a/openapi3/testdata/apis_guru_openapi_directory/shorten_rest_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/shorten_rest_1_0_0_openapi_yaml__validate deleted file mode 100644 index 179f29ea8..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/shorten_rest_1_0_0_openapi_yaml__validate +++ /dev/null @@ -1,10 +0,0 @@ -invalid components: schema "ClicksFilterModel": invalid example: unhandled value of type time.Time -Schema: - { - "description": "date From", - "example": "2001-05-02T00:00:00Z", - "type": "string" - } - -Value: - "2001-05-02T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/spotify_com_sonallux_2023_2_27_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/spotify_com_sonallux_2023_2_27_openapi_yaml__validate deleted file mode 100644 index f2848383b..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/spotify_com_sonallux_2023_2_27_openapi_yaml__validate +++ /dev/null @@ -1,10 +0,0 @@ -invalid components: schema "AudiobookObject": invalid allOf element: invalid example: unhandled value of type time.Time -Schema: - { - "description": "The date the episode was first released, for example `\"1981-12-15\"`. Depending on the precision, it might be shown as `\"1981\"` or `\"1981-12\"`.\n", - "example": "1981-12-15T00:00:00Z", - "type": "string" - } - -Value: - "1981-12-15T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/statsocial_com_1_0_0_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/statsocial_com_1_0_0_openapi_yaml__load deleted file mode 100644 index 099ffe7fb..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/statsocial_com_1_0_0_openapi_yaml__load +++ /dev/null @@ -1 +0,0 @@ -map key "18_24" not found diff --git a/openapi3/testdata/apis_guru_openapi_directory/taxrates_io_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/taxrates_io_1_0_0_openapi_yaml__validate deleted file mode 100644 index 87c7c3af9..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/taxrates_io_1_0_0_openapi_yaml__validate +++ /dev/null @@ -1,9 +0,0 @@ -invalid paths: invalid path /v1/tax/countrycode: invalid operation GET: parameter "date" schema is invalid: invalid example: unhandled value of type time.Time -Schema: - { - "example": "2020-09-02T00:00:00Z", - "type": "string" - } - -Value: - "2020-09-02T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/telematicssdk_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/telematicssdk_com_1_0_0_openapi_yaml__validate deleted file mode 100644 index c5805224b..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/telematicssdk_com_1_0_0_openapi_yaml__validate +++ /dev/null @@ -1,9 +0,0 @@ -invalid paths: invalid path /mobilesdk/stage/track/get_track/v1: invalid operation GET: invalid example: unhandled value of type time.Time -Schema: - { - "example": "2021-02-27T13:42:48+01:00", - "type": "string" - } - -Value: - "2021-02-27T13:42:48+01:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/theracingapi_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/theracingapi_com_1_0_0_openapi_yaml__validate deleted file mode 100644 index bf2a43549..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/theracingapi_com_1_0_0_openapi_yaml__validate +++ /dev/null @@ -1,11 +0,0 @@ -invalid paths: invalid path /v1/racecards/pro: invalid operation GET: parameter "date" schema is invalid: invalid default: unhandled value of type time.Time -Schema: - { - "default": "2023-10-15T00:00:00Z", - "description": "Query racecards by date with format YYYY-MM-DD (e.g 2023-04-05)", - "title": "Date", - "type": "string" - } - -Value: - "2023-10-15T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/tokenmetrics_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/tokenmetrics_com_1_0_0_openapi_yaml__validate deleted file mode 100644 index 6bce3d275..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/tokenmetrics_com_1_0_0_openapi_yaml__validate +++ /dev/null @@ -1,9 +0,0 @@ -invalid paths: invalid path /v1/indices: invalid operation GET: parameter "startDate" schema is invalid: invalid example: unhandled value of type time.Time -Schema: - { - "example": "2023-01-10T00:00:00Z", - "type": "string" - } - -Value: - "2023-01-10T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/up_com_au_v1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/up_com_au_v1_openapi_yaml__validate deleted file mode 100644 index d8578f810..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/up_com_au_v1_openapi_yaml__validate +++ /dev/null @@ -1,9 +0,0 @@ -invalid paths: invalid path /accounts/{accountId}/transactions: invalid operation GET: invalid example: unhandled value of type time.Time -Schema: - { - "format": "date-time", - "type": "string" - } - -Value: - "2020-01-01T01:02:03+10:00" diff --git a/openapi3/testdata/apis_guru_openapi_directory/va_gov_confirmation_0_0_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/va_gov_confirmation_0_0_1_openapi_yaml__validate deleted file mode 100644 index 04ba3d8d7..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/va_gov_confirmation_0_0_1_openapi_yaml__validate +++ /dev/null @@ -1,11 +0,0 @@ -invalid components: schema "VeteranStatusRequest": invalid example: unhandled value of type time.Time -Schema: - { - "deprecated": true, - "description": "Birth date for the person of interest in any valid ISO8601 format", - "example": "1965-01-01T00:00:00Z", - "type": "string" - } - -Value: - "1965-01-01T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vercel_com_0_0_1_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/vercel_com_0_0_1_openapi_yaml__load index 2a6522f53..44dd91250 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vercel_com_0_0_1_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/vercel_com_0_0_1_openapi_yaml__load @@ -1 +1,2 @@ -failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal bool into field Schema.properties of type openapi3.Schema +failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: unmarshal errors: + line 860: cannot unmarshal !!bool `false` into openapi3.SchemaBis diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Giftcard_API_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Giftcard_API_1_0_openapi_yaml__validate deleted file mode 100644 index d99aa1c57..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Giftcard_API_1_0_openapi_yaml__validate +++ /dev/null @@ -1,10 +0,0 @@ -invalid components: schema "CreateGiftCardRequest": invalid example: unhandled value of type time.Time -Schema: - { - "description": "It must be in the format `YYYY-MM-DDThh:mm:ss.fff`.", - "example": "2020-09-01T13:15:30Z", - "type": "string" - } - -Value: - "2020-09-01T13:15:30Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_MasterData_API__1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_MasterData_API__1_0_openapi_yaml__validate deleted file mode 100644 index 9cc9311c2..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_MasterData_API__1_0_openapi_yaml__validate +++ /dev/null @@ -1,16 +0,0 @@ -invalid components: schema "ArEVentilaO": invalid example: Error at "/Date": unhandled value of type time.Time -Schema: - { - "type": "string" - } - -Value: - "2016-10-18T16:53:31.0842607Z" - | Error at "/Until": unhandled value of type time.Time -Schema: - { - "type": "string" - } - -Value: - "2017-04-16T16:53:31.0842607Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Master_Data_API__1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Master_Data_API__1_0_openapi_yaml__validate deleted file mode 100644 index 9cc9311c2..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Master_Data_API__1_0_openapi_yaml__validate +++ /dev/null @@ -1,16 +0,0 @@ -invalid components: schema "ArEVentilaO": invalid example: Error at "/Date": unhandled value of type time.Time -Schema: - { - "type": "string" - } - -Value: - "2016-10-18T16:53:31.0842607Z" - | Error at "/Until": unhandled value of type time.Time -Schema: - { - "type": "string" - } - -Value: - "2017-04-16T16:53:31.0842607Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Payments_Gateway_API_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Payments_Gateway_API_1_0_openapi_yaml__validate deleted file mode 100644 index 0e97dbe87..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Payments_Gateway_API_1_0_openapi_yaml__validate +++ /dev/null @@ -1,8 +0,0 @@ -invalid components: schema "Action": invalid example: Error at "/date": unhandled value of type time.Time -Schema: - { - "type": "string" - } - -Value: - "2018-06-05T12:55:58.6262759Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Pricing_API_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Pricing_API_1_0_openapi_yaml__validate deleted file mode 100644 index 11ae3d6fb..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Pricing_API_1_0_openapi_yaml__validate +++ /dev/null @@ -1,18 +0,0 @@ -invalid components: schema "DateRange": invalid example: Error at "/from": unhandled value of type time.Time -Schema: - { - "description": "Indicates the date and time when the fixed price will start to be valid.", - "type": "string" - } - -Value: - "2017-12-07T14:30:00Z" - | Error at "/to": unhandled value of type time.Time -Schema: - { - "description": "Indicates the date and time from which the fixed price will no longer be valid.", - "type": "string" - } - -Value: - "2017-12-30T14:30:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Pricing_Hub_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Pricing_Hub_1_0_openapi_yaml__validate deleted file mode 100644 index baa2496a2..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Pricing_Hub_1_0_openapi_yaml__validate +++ /dev/null @@ -1,18 +0,0 @@ -invalid paths: invalid path /api/pricing-hub/prices: invalid operation POST: invalid example: Error at "/items/0/priceValidUntil": unhandled value of type time.Time -Schema: - { - "description": "The moment up until the price is valid. After that moment, it will be necessary to call the pricing API again. The format of the string is in RFC3339", - "type": "string" - } - -Value: - "2022-03-24T14:57:19Z" - | Error at "/items/1/priceValidUntil": unhandled value of type time.Time -Schema: - { - "description": "The moment up until the price is valid. After that moment, it will be necessary to call the pricing API again. The format of the string is in RFC3339", - "type": "string" - } - -Value: - "2022-03-04T20:00:18Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Profile_System_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Profile_System_1_0_openapi_yaml__validate deleted file mode 100644 index cb6373e30..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Profile_System_1_0_openapi_yaml__validate +++ /dev/null @@ -1,10 +0,0 @@ -invalid components: schema "profile": invalid example: unhandled value of type time.Time -Schema: - { - "description": "Client's birth date in ISO 8601 format.", - "example": "1925-11-17T00:00:00Z", - "type": "string" - } - -Value: - "1925-11-17T00:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Promotions__1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Promotions__1_0_openapi_yaml__validate deleted file mode 100644 index 10c11cc60..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Promotions__1_0_openapi_yaml__validate +++ /dev/null @@ -1,16 +0,0 @@ -invalid components: schema "SavepriceRequest": invalid example: Error at "/validFrom": unhandled value of type time.Time -Schema: - { - "type": "string" - } - -Value: - "2016-01-01T02:00:00Z" - | Error at "/validTo": unhandled value of type time.Time -Schema: - { - "type": "string" - } - -Value: - "2017-01-01T02:00:00Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Reviews_and_Ratings_API_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Reviews_and_Ratings_API_1_0_openapi_yaml__validate deleted file mode 100644 index 6727db4cd..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Reviews_and_Ratings_API_1_0_openapi_yaml__validate +++ /dev/null @@ -1,9 +0,0 @@ -invalid paths: invalid path /review: invalid operation POST: invalid example: Error at "/searchDate": unhandled value of type time.Time -Schema: - { - "description": "Review's search date.", - "type": "string" - } - -Value: - "2022-04-19T18:55:58Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Search_API_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Search_API_1_0_openapi_yaml__validate deleted file mode 100644 index 10cda0948..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Search_API_1_0_openapi_yaml__validate +++ /dev/null @@ -1,11 +0,0 @@ -invalid paths: invalid path /api/catalog_system/pub/products/crossselling/whoboughtalsobought/{productId}: invalid operation GET: invalid example: unhandled value of type time.Time -Schema: - { - "description": "Date and time of the last update of the image.", - "example": "2020-10-07T12:49:27.58Z", - "title": "imageLastModified", - "type": "string" - } - -Value: - "2020-10-07T12:49:27.58Z" diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_VTEX_Do_API_1_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_VTEX_Do_API_1_0_openapi_yaml__validate deleted file mode 100644 index 6dc280d6a..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_VTEX_Do_API_1_0_openapi_yaml__validate +++ /dev/null @@ -1,8 +0,0 @@ -invalid components: schema "NewTaskRequest": invalid example: Error at "/dueDate": unhandled value of type time.Time -Schema: - { - "type": "string" - } - -Value: - "2016-03-01T00:00:00Z" From 4a209a4c72e158c1ad5589a0f0d9b64db8065b9e Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 14:56:22 +0300 Subject: [PATCH 11/31] Generate the repetitive UnmarshalYAML methods The 24 shadow-struct methods differed only by type name, and the 9 $ref wrapper methods only by that and one conditional. They were produced by a throwaway script and committed as if hand-written, which is the worse half of the problem: nothing tied them to the types they mirror, and a new type would have been silently missed. Both now follow the pattern already used for refs.go: a build-ignored generator, an embedded template, a DO NOT EDIT header, and a go:generate directive. The $ref methods go into refs.tmpl, alongside the UnmarshalJSON they mirror, so the two cannot drift and a new ref type gets both. The rest come from nativeyaml.tmpl. Generics do not help here. The method must exist on each named type, and the shadow type that stops the decoder recursing cannot be expressed from a type parameter, so the declarations have to be written either way -- by hand or by a generator. Left hand-written: the maplike collections and the union-typed values, which do not share the shape. Generation is idempotent, and moving the $ref methods into the template fixed a failure, since the generated version handles extra keys as the JSON one does. --- .github/docs/openapi3.txt | 121 ++++++++++++++++++++++++++++++++ openapi3/native_yaml.go | 2 + openapi3/native_yaml_refs.go | 96 +------------------------ openapi3/native_yaml_shadow.go | 106 +++++++++++++++++----------- openapi3/nativeyaml.tmpl | 27 +++++++ openapi3/nativeyamlgenerator.go | 72 +++++++++++++++++++ openapi3/refs.go | 100 ++++++++++++++++++++++++++ openapi3/refs.tmpl | 30 ++++++++ 8 files changed, 419 insertions(+), 135 deletions(-) create mode 100644 openapi3/nativeyaml.tmpl create mode 100644 openapi3/nativeyamlgenerator.go diff --git a/.github/docs/openapi3.txt b/.github/docs/openapi3.txt index f710e8524..39c9cbece 100644 --- a/.github/docs/openapi3.txt +++ b/.github/docs/openapi3.txt @@ -34,6 +34,9 @@ Version detection is available via helper methods: // Handle OpenAPI 3.2 specific features } +Code generated by go generate using nativeyaml.tmpl; DO NOT EDIT +native_yaml_shadow.go. + Code generated by go generate using refs.tmpl; DO NOT EDIT refs.go. CONSTANTS @@ -321,6 +324,9 @@ func (bs BoolSchema) MarshalYAML() (any, error) func (bs *BoolSchema) UnmarshalJSON(data []byte) error UnmarshalJSON sets BoolSchema to a copy of data. +func (bs *BoolSchema) UnmarshalYAML(node *yaml.Node) error + BoolSchema is `true`/`false` or a schema. + type Callback struct { Extensions map[string]any `json:"-" yaml:"-"` Origin *Origin `json:"-" yaml:"-"` @@ -365,6 +371,8 @@ func (callback *Callback) Set(key string, value *PathItem) func (callback *Callback) UnmarshalJSON(data []byte) (err error) UnmarshalJSON sets Callback to a copy of data. +func (callback *Callback) UnmarshalYAML(node *yaml.Node) error + func (callback *Callback) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if Callback does not comply with the OpenAPI spec. @@ -411,6 +419,9 @@ func (x *CallbackRef) RefString() string func (x *CallbackRef) UnmarshalJSON(data []byte) error UnmarshalJSON sets CallbackRef to a copy of data. +func (x *CallbackRef) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets CallbackRef from node. + func (x *CallbackRef) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if CallbackRef does not comply with the OpenAPI spec. @@ -504,6 +515,9 @@ func (components Components) MarshalYAML() (any, error) func (components *Components) UnmarshalJSON(data []byte) error UnmarshalJSON sets Components to a copy of data. +func (components *Components) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets Components from node. + func (components *Components) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if Components does not comply with the OpenAPI spec. @@ -551,6 +565,9 @@ func (contact Contact) MarshalYAML() (any, error) func (contact *Contact) UnmarshalJSON(data []byte) error UnmarshalJSON sets Contact to a copy of data. +func (contact *Contact) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets Contact from node. + func (contact *Contact) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if Contact does not comply with the OpenAPI spec. @@ -643,6 +660,9 @@ func (discriminator Discriminator) MarshalYAML() (any, error) func (discriminator *Discriminator) UnmarshalJSON(data []byte) error UnmarshalJSON sets Discriminator to a copy of data. +func (discriminator *Discriminator) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets Discriminator from node. + func (discriminator *Discriminator) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if Discriminator does not comply with the OpenAPI spec. @@ -778,6 +798,9 @@ func (encoding *Encoding) SerializationMethod() *SerializationMethod func (encoding *Encoding) UnmarshalJSON(data []byte) error UnmarshalJSON sets Encoding to a copy of data. +func (encoding *Encoding) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets Encoding from node. + func (encoding *Encoding) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if Encoding does not comply with the OpenAPI spec. @@ -829,6 +852,9 @@ func (example Example) MarshalYAML() (any, error) func (example *Example) UnmarshalJSON(data []byte) error UnmarshalJSON sets Example to a copy of data. +func (example *Example) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets Example from node. + func (example *Example) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if Example does not comply with the OpenAPI spec. @@ -872,6 +898,9 @@ func (x *ExampleRef) RefString() string func (x *ExampleRef) UnmarshalJSON(data []byte) error UnmarshalJSON sets ExampleRef to a copy of data. +func (x *ExampleRef) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets ExampleRef from node. + func (x *ExampleRef) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if ExampleRef does not comply with the OpenAPI spec. @@ -934,6 +963,10 @@ func (eb ExclusiveBound) MarshalYAML() (any, error) func (eb *ExclusiveBound) UnmarshalJSON(data []byte) error UnmarshalJSON sets ExclusiveBound to a copy of data. +func (eb *ExclusiveBound) UnmarshalYAML(node *yaml.Node) error + ExclusiveBound is a bool in OAS 3.0, where it modifies minimum/maximum, + or a number in 3.1, where it is the bound itself. + type ExternalDocs struct { Extensions map[string]any `json:"-" yaml:"-"` Origin *Origin `json:"-" yaml:"-"` @@ -953,6 +986,9 @@ func (e ExternalDocs) MarshalYAML() (any, error) func (e *ExternalDocs) UnmarshalJSON(data []byte) error UnmarshalJSON sets ExternalDocs to a copy of data. +func (e *ExternalDocs) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets ExternalDocs from node. + func (e *ExternalDocs) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if ExternalDocs does not comply with the OpenAPI spec. @@ -1071,6 +1107,9 @@ func (header *Header) SerializationMethod() (*SerializationMethod, error) func (header *Header) UnmarshalJSON(data []byte) error UnmarshalJSON sets Header to a copy of data. +func (header *Header) UnmarshalYAML(node *yaml.Node) error + Header embeds Parameter and carries no fields of its own. + func (header *Header) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if Header does not comply with the OpenAPI spec. @@ -1150,6 +1189,9 @@ func (x *HeaderRef) RefString() string func (x *HeaderRef) UnmarshalJSON(data []byte) error UnmarshalJSON sets HeaderRef to a copy of data. +func (x *HeaderRef) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets HeaderRef from node. + func (x *HeaderRef) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if HeaderRef does not comply with the OpenAPI spec. @@ -1198,6 +1240,9 @@ func (info *Info) MarshalYAML() (any, error) func (info *Info) UnmarshalJSON(data []byte) error UnmarshalJSON sets Info to a copy of data. +func (info *Info) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets Info from node. + func (info *Info) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if Info does not comply with the OpenAPI spec. @@ -1343,6 +1388,9 @@ func (license License) MarshalYAML() (any, error) func (license *License) UnmarshalJSON(data []byte) error UnmarshalJSON sets License to a copy of data. +func (license *License) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets License from node. + func (license *License) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if License does not comply with the OpenAPI spec. @@ -1387,6 +1435,9 @@ func (link Link) MarshalYAML() (any, error) func (link *Link) UnmarshalJSON(data []byte) error UnmarshalJSON sets Link to a copy of data. +func (link *Link) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets Link from node. + func (link *Link) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if Link does not comply with the OpenAPI spec. @@ -1442,6 +1493,9 @@ func (x *LinkRef) RefString() string func (x *LinkRef) UnmarshalJSON(data []byte) error UnmarshalJSON sets LinkRef to a copy of data. +func (x *LinkRef) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets LinkRef from node. + func (x *LinkRef) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if LinkRef does not comply with the OpenAPI spec. @@ -1571,6 +1625,9 @@ func (mediaType MediaType) MarshalYAML() (any, error) func (mediaType *MediaType) UnmarshalJSON(data []byte) error UnmarshalJSON sets MediaType to a copy of data. +func (mediaType *MediaType) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets MediaType from node. + func (mediaType *MediaType) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if MediaType does not comply with the OpenAPI spec. @@ -1687,6 +1744,9 @@ func (flow OAuthFlow) MarshalYAML() (any, error) func (flow *OAuthFlow) UnmarshalJSON(data []byte) error UnmarshalJSON sets OAuthFlow to a copy of data. +func (flow *OAuthFlow) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets OAuthFlow from node. + func (flow *OAuthFlow) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if OAuthFlows does not comply with the OpenAPI spec. @@ -1768,6 +1828,9 @@ func (flows OAuthFlows) MarshalYAML() (any, error) func (flows *OAuthFlows) UnmarshalJSON(data []byte) error UnmarshalJSON sets OAuthFlows to a copy of data. +func (flows *OAuthFlows) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets OAuthFlows from node. + func (flows *OAuthFlows) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if OAuthFlows does not comply with the OpenAPI spec. @@ -1845,6 +1908,9 @@ func (operation Operation) MarshalYAML() (any, error) func (operation *Operation) UnmarshalJSON(data []byte) error UnmarshalJSON sets Operation to a copy of data. +func (operation *Operation) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets Operation from node. + func (operation *Operation) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if Operation does not comply with the OpenAPI spec. @@ -1927,6 +1993,9 @@ func (parameter *Parameter) SerializationMethod() (*SerializationMethod, error) func (parameter *Parameter) UnmarshalJSON(data []byte) error UnmarshalJSON sets Parameter to a copy of data. +func (parameter *Parameter) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets Parameter from node. + func (parameter *Parameter) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if Parameter does not comply with the OpenAPI spec. @@ -2027,6 +2096,9 @@ func (x *ParameterRef) RefString() string func (x *ParameterRef) UnmarshalJSON(data []byte) error UnmarshalJSON sets ParameterRef to a copy of data. +func (x *ParameterRef) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets ParameterRef from node. + func (x *ParameterRef) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if ParameterRef does not comply with the OpenAPI spec. @@ -2089,6 +2161,9 @@ func (pathItem *PathItem) SetOperation(method string, operation *Operation) func (pathItem *PathItem) UnmarshalJSON(data []byte) error UnmarshalJSON sets PathItem to a copy of data. +func (pathItem *PathItem) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets PathItem from node. + func (pathItem *PathItem) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if PathItem does not comply with the OpenAPI spec. @@ -2223,6 +2298,8 @@ func (paths *Paths) Set(key string, value *PathItem) func (paths *Paths) UnmarshalJSON(data []byte) (err error) UnmarshalJSON sets Paths to a copy of data. +func (paths *Paths) UnmarshalYAML(node *yaml.Node) error + func (paths *Paths) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if Paths does not comply with the OpenAPI spec. @@ -2338,6 +2415,9 @@ func (requestBody RequestBody) MarshalYAML() (any, error) func (requestBody *RequestBody) UnmarshalJSON(data []byte) error UnmarshalJSON sets RequestBody to a copy of data. +func (requestBody *RequestBody) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets RequestBody from node. + func (requestBody *RequestBody) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if RequestBody does not comply with the OpenAPI spec. @@ -2406,6 +2486,9 @@ func (x *RequestBodyRef) RefString() string func (x *RequestBodyRef) UnmarshalJSON(data []byte) error UnmarshalJSON sets RequestBodyRef to a copy of data. +func (x *RequestBodyRef) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets RequestBodyRef from node. + func (x *RequestBodyRef) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if RequestBodyRef does not comply with the OpenAPI spec. @@ -2460,6 +2543,9 @@ func (response Response) MarshalYAML() (any, error) func (response *Response) UnmarshalJSON(data []byte) error UnmarshalJSON sets Response to a copy of data. +func (response *Response) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets Response from node. + func (response *Response) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if Response does not comply with the OpenAPI spec. @@ -2523,6 +2609,9 @@ func (x *ResponseRef) RefString() string func (x *ResponseRef) UnmarshalJSON(data []byte) error UnmarshalJSON sets ResponseRef to a copy of data. +func (x *ResponseRef) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets ResponseRef from node. + func (x *ResponseRef) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if ResponseRef does not comply with the OpenAPI spec. @@ -2581,6 +2670,8 @@ func (responses *Responses) Status(status int) *ResponseRef func (responses *Responses) UnmarshalJSON(data []byte) (err error) UnmarshalJSON sets Responses to a copy of data. +func (responses *Responses) UnmarshalYAML(node *yaml.Node) error + func (responses *Responses) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if Responses does not comply with the OpenAPI spec. @@ -2745,6 +2836,9 @@ func (schema *Schema) PermitsNull() bool func (schema *Schema) UnmarshalJSON(data []byte) error UnmarshalJSON sets Schema to a copy of data. +func (schema *Schema) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets Schema from node. + func (schema *Schema) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if Schema does not comply with the OpenAPI spec. @@ -2975,6 +3069,9 @@ func (x *SchemaRef) RefString() string func (x *SchemaRef) UnmarshalJSON(data []byte) error UnmarshalJSON sets SchemaRef to a copy of data. +func (x *SchemaRef) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets SchemaRef from node. + func (x *SchemaRef) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if SchemaRef does not comply with the OpenAPI spec. @@ -3205,6 +3302,9 @@ func (ss SecurityScheme) MarshalYAML() (any, error) func (ss *SecurityScheme) UnmarshalJSON(data []byte) error UnmarshalJSON sets SecurityScheme to a copy of data. +func (ss *SecurityScheme) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets SecurityScheme from node. + func (ss *SecurityScheme) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if SecurityScheme does not comply with the OpenAPI spec. @@ -3302,6 +3402,9 @@ func (x *SecuritySchemeRef) RefString() string func (x *SecuritySchemeRef) UnmarshalJSON(data []byte) error UnmarshalJSON sets SecuritySchemeRef to a copy of data. +func (x *SecuritySchemeRef) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets SecuritySchemeRef from node. + func (x *SecuritySchemeRef) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if SecuritySchemeRef does not comply with the OpenAPI spec. @@ -3347,6 +3450,9 @@ func (server Server) ParameterNames() ([]string, error) func (server *Server) UnmarshalJSON(data []byte) error UnmarshalJSON sets Server to a copy of data. +func (server *Server) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets Server from node. + func (server *Server) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if Server does not comply with the OpenAPI spec. @@ -3401,6 +3507,9 @@ func (serverVariable ServerVariable) MarshalYAML() (any, error) func (serverVariable *ServerVariable) UnmarshalJSON(data []byte) error UnmarshalJSON sets ServerVariable to a copy of data. +func (serverVariable *ServerVariable) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets ServerVariable from node. + func (serverVariable *ServerVariable) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if ServerVariable does not comply with the OpenAPI spec. @@ -3557,6 +3666,9 @@ func (doc *T) SetStringFormatValidators(validators map[string]StringFormatValida func (doc *T) UnmarshalJSON(data []byte) error UnmarshalJSON sets T to a copy of data. +func (doc *T) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets T from node. + func (doc *T) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if T does not comply with the OpenAPI spec. Validations Options can be provided to modify the validation behavior. @@ -3620,6 +3732,9 @@ func (t Tag) MarshalYAML() (any, error) func (t *Tag) UnmarshalJSON(data []byte) error UnmarshalJSON sets Tag to a copy of data. +func (t *Tag) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets Tag from node. + func (t *Tag) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if Tag does not comply with the OpenAPI spec. @@ -3772,6 +3887,9 @@ func (types *Types) Slice() []string func (types *Types) UnmarshalJSON(data []byte) error +func (types *Types) UnmarshalYAML(node *yaml.Node) error + Types is a string or a list of strings. + type UnevaluatedItemsFieldFor31Plus struct{ ValidationError } func (e *UnevaluatedItemsFieldFor31Plus) As(target any) bool @@ -4025,6 +4143,9 @@ func (xml XML) MarshalYAML() (any, error) func (xml *XML) UnmarshalJSON(data []byte) error UnmarshalJSON sets XML to a copy of data. +func (xml *XML) UnmarshalYAML(node *yaml.Node) error + UnmarshalYAML sets XML from node. + func (xml *XML) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if XML does not comply with the OpenAPI spec. diff --git a/openapi3/native_yaml.go b/openapi3/native_yaml.go index 04f782e44..13d8e7039 100644 --- a/openapi3/native_yaml.go +++ b/openapi3/native_yaml.go @@ -1,5 +1,7 @@ package openapi3 +//go:generate go run nativeyamlgenerator.go + import ( "reflect" "strings" diff --git a/openapi3/native_yaml_refs.go b/openapi3/native_yaml_refs.go index 24c46c0f9..8b2c2399a 100644 --- a/openapi3/native_yaml_refs.go +++ b/openapi3/native_yaml_refs.go @@ -1,8 +1,6 @@ package openapi3 -// UnmarshalYAML for the $ref wrappers. A node holding a $ref carries the -// reference, and may carry summary, description and extensions alongside it; -// anything else is the value. +// Shared by the generated $ref wrapper UnmarshalYAML methods in refs.go. import ( "strings" @@ -45,95 +43,3 @@ func unmarshalRefYAML(node *yaml.Node, ref *string, summary, description **strin } return true } - -func (x *CallbackRef) UnmarshalYAML(node *yaml.Node) error { - x.Origin = originFromNode(node, nativeOriginFile()) - if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { - return nil - } - return node.Decode(&x.Value) -} - -func (x *ExampleRef) UnmarshalYAML(node *yaml.Node) error { - x.Origin = originFromNode(node, nativeOriginFile()) - if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { - return nil - } - return node.Decode(&x.Value) -} - -func (x *HeaderRef) UnmarshalYAML(node *yaml.Node) error { - x.Origin = originFromNode(node, nativeOriginFile()) - if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { - return nil - } - return node.Decode(&x.Value) -} - -func (x *LinkRef) UnmarshalYAML(node *yaml.Node) error { - x.Origin = originFromNode(node, nativeOriginFile()) - if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { - return nil - } - return node.Decode(&x.Value) -} - -func (x *ParameterRef) UnmarshalYAML(node *yaml.Node) error { - x.Origin = originFromNode(node, nativeOriginFile()) - if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { - return nil - } - return node.Decode(&x.Value) -} - -func (x *RequestBodyRef) UnmarshalYAML(node *yaml.Node) error { - x.Origin = originFromNode(node, nativeOriginFile()) - if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { - return nil - } - return node.Decode(&x.Value) -} - -func (x *ResponseRef) UnmarshalYAML(node *yaml.Node) error { - x.Origin = originFromNode(node, nativeOriginFile()) - if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { - return nil - } - return node.Decode(&x.Value) -} - -func (x *SecuritySchemeRef) UnmarshalYAML(node *yaml.Node) error { - x.Origin = originFromNode(node, nativeOriginFile()) - if unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { - return nil - } - return node.Decode(&x.Value) -} - -// SchemaRef takes no summary or description. OAS 3.1 allows schema keywords -// alongside a $ref, which are held on sibling until the reference resolves and -// they can be merged into the resolved value. -func (x *SchemaRef) UnmarshalYAML(node *yaml.Node) error { - x.Origin = originFromNode(node, nativeOriginFile()) - if !unmarshalRefYAML(node, &x.Ref, nil, nil, &x.Extensions) { - return node.Decode(&x.Value) - } - var siblings []string - for i := 0; i+1 < len(node.Content); i += 2 { - k := node.Content[i].Value - if k == "$ref" { - continue - } - x.extra = append(x.extra, k) - if !strings.HasPrefix(k, "x-") { - siblings = append(siblings, k) - } - } - if len(siblings) > 0 { - var sibling Schema - if err := node.Decode(&sibling); err == nil { - x.sibling = &sibling - } - } - return nil -} diff --git a/openapi3/native_yaml_shadow.go b/openapi3/native_yaml_shadow.go index 8fcb20776..ec24b1d51 100644 --- a/openapi3/native_yaml_shadow.go +++ b/openapi3/native_yaml_shadow.go @@ -1,13 +1,16 @@ +// Code generated by go generate using nativeyaml.tmpl; DO NOT EDIT native_yaml_shadow.go. package openapi3 -// Generated. Each method is the same three steps: decode into a shadow type so -// the decoder does not recurse into this method, collect the keys the struct -// does not declare as extensions, and read the origin off the node. - import ( yaml "go.yaml.in/yaml/v3" ) +// UnmarshalYAML for the types whose YAML form is a mapping of declared fields +// plus extensions. Each decodes into a shadow type, so the decoder does not +// recurse into this method, collects the keys the struct does not declare, and +// reads the origin off the node. + +// UnmarshalYAML sets Components from node. func (components *Components) UnmarshalYAML(node *yaml.Node) error { type ComponentsBis Components var x ComponentsBis @@ -22,6 +25,7 @@ func (components *Components) UnmarshalYAML(node *yaml.Node) error { return nil } +// UnmarshalYAML sets Contact from node. func (contact *Contact) UnmarshalYAML(node *yaml.Node) error { type ContactBis Contact var x ContactBis @@ -36,6 +40,7 @@ func (contact *Contact) UnmarshalYAML(node *yaml.Node) error { return nil } +// UnmarshalYAML sets Discriminator from node. func (discriminator *Discriminator) UnmarshalYAML(node *yaml.Node) error { type DiscriminatorBis Discriminator var x DiscriminatorBis @@ -50,6 +55,7 @@ func (discriminator *Discriminator) UnmarshalYAML(node *yaml.Node) error { return nil } +// UnmarshalYAML sets Encoding from node. func (encoding *Encoding) UnmarshalYAML(node *yaml.Node) error { type EncodingBis Encoding var x EncodingBis @@ -64,6 +70,7 @@ func (encoding *Encoding) UnmarshalYAML(node *yaml.Node) error { return nil } +// UnmarshalYAML sets Example from node. func (example *Example) UnmarshalYAML(node *yaml.Node) error { type ExampleBis Example var x ExampleBis @@ -78,6 +85,7 @@ func (example *Example) UnmarshalYAML(node *yaml.Node) error { return nil } +// UnmarshalYAML sets ExternalDocs from node. func (e *ExternalDocs) UnmarshalYAML(node *yaml.Node) error { type ExternalDocsBis ExternalDocs var x ExternalDocsBis @@ -92,6 +100,7 @@ func (e *ExternalDocs) UnmarshalYAML(node *yaml.Node) error { return nil } +// UnmarshalYAML sets Info from node. func (info *Info) UnmarshalYAML(node *yaml.Node) error { type InfoBis Info var x InfoBis @@ -106,6 +115,7 @@ func (info *Info) UnmarshalYAML(node *yaml.Node) error { return nil } +// UnmarshalYAML sets License from node. func (license *License) UnmarshalYAML(node *yaml.Node) error { type LicenseBis License var x LicenseBis @@ -120,6 +130,7 @@ func (license *License) UnmarshalYAML(node *yaml.Node) error { return nil } +// UnmarshalYAML sets Link from node. func (link *Link) UnmarshalYAML(node *yaml.Node) error { type LinkBis Link var x LinkBis @@ -134,6 +145,7 @@ func (link *Link) UnmarshalYAML(node *yaml.Node) error { return nil } +// UnmarshalYAML sets MediaType from node. func (mediaType *MediaType) UnmarshalYAML(node *yaml.Node) error { type MediaTypeBis MediaType var x MediaTypeBis @@ -148,20 +160,37 @@ func (mediaType *MediaType) UnmarshalYAML(node *yaml.Node) error { return nil } -func (doc *T) UnmarshalYAML(node *yaml.Node) error { - type TBis T - var x TBis +// UnmarshalYAML sets OAuthFlow from node. +func (flow *OAuthFlow) UnmarshalYAML(node *yaml.Node) error { + type OAuthFlowBis OAuthFlow + var x OAuthFlowBis ext, err := decodeStructWithExtensions(node, &x) if err != nil { return err } x.Extensions = ext x.Origin = originFromNode(node, nativeOriginFile()) - *doc = T(x) - setChildOriginKeys(node, doc, nativeOriginFile()) + *flow = OAuthFlow(x) + setChildOriginKeys(node, flow, nativeOriginFile()) + return nil +} + +// UnmarshalYAML sets OAuthFlows from node. +func (flows *OAuthFlows) UnmarshalYAML(node *yaml.Node) error { + type OAuthFlowsBis OAuthFlows + var x OAuthFlowsBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile()) + *flows = OAuthFlows(x) + setChildOriginKeys(node, flows, nativeOriginFile()) return nil } +// UnmarshalYAML sets Operation from node. func (operation *Operation) UnmarshalYAML(node *yaml.Node) error { type OperationBis Operation var x OperationBis @@ -176,6 +205,7 @@ func (operation *Operation) UnmarshalYAML(node *yaml.Node) error { return nil } +// UnmarshalYAML sets Parameter from node. func (parameter *Parameter) UnmarshalYAML(node *yaml.Node) error { type ParameterBis Parameter var x ParameterBis @@ -190,6 +220,7 @@ func (parameter *Parameter) UnmarshalYAML(node *yaml.Node) error { return nil } +// UnmarshalYAML sets PathItem from node. func (pathItem *PathItem) UnmarshalYAML(node *yaml.Node) error { type PathItemBis PathItem var x PathItemBis @@ -204,6 +235,7 @@ func (pathItem *PathItem) UnmarshalYAML(node *yaml.Node) error { return nil } +// UnmarshalYAML sets RequestBody from node. func (requestBody *RequestBody) UnmarshalYAML(node *yaml.Node) error { type RequestBodyBis RequestBody var x RequestBodyBis @@ -218,6 +250,7 @@ func (requestBody *RequestBody) UnmarshalYAML(node *yaml.Node) error { return nil } +// UnmarshalYAML sets Response from node. func (response *Response) UnmarshalYAML(node *yaml.Node) error { type ResponseBis Response var x ResponseBis @@ -232,6 +265,7 @@ func (response *Response) UnmarshalYAML(node *yaml.Node) error { return nil } +// UnmarshalYAML sets Schema from node. func (schema *Schema) UnmarshalYAML(node *yaml.Node) error { type SchemaBis Schema var x SchemaBis @@ -246,6 +280,7 @@ func (schema *Schema) UnmarshalYAML(node *yaml.Node) error { return nil } +// UnmarshalYAML sets SecurityScheme from node. func (ss *SecurityScheme) UnmarshalYAML(node *yaml.Node) error { type SecuritySchemeBis SecurityScheme var x SecuritySchemeBis @@ -260,34 +295,7 @@ func (ss *SecurityScheme) UnmarshalYAML(node *yaml.Node) error { return nil } -func (flows *OAuthFlows) UnmarshalYAML(node *yaml.Node) error { - type OAuthFlowsBis OAuthFlows - var x OAuthFlowsBis - ext, err := decodeStructWithExtensions(node, &x) - if err != nil { - return err - } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *flows = OAuthFlows(x) - setChildOriginKeys(node, flows, nativeOriginFile()) - return nil -} - -func (flow *OAuthFlow) UnmarshalYAML(node *yaml.Node) error { - type OAuthFlowBis OAuthFlow - var x OAuthFlowBis - ext, err := decodeStructWithExtensions(node, &x) - if err != nil { - return err - } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *flow = OAuthFlow(x) - setChildOriginKeys(node, flow, nativeOriginFile()) - return nil -} - +// UnmarshalYAML sets Server from node. func (server *Server) UnmarshalYAML(node *yaml.Node) error { type ServerBis Server var x ServerBis @@ -302,6 +310,7 @@ func (server *Server) UnmarshalYAML(node *yaml.Node) error { return nil } +// UnmarshalYAML sets ServerVariable from node. func (serverVariable *ServerVariable) UnmarshalYAML(node *yaml.Node) error { type ServerVariableBis ServerVariable var x ServerVariableBis @@ -316,7 +325,23 @@ func (serverVariable *ServerVariable) UnmarshalYAML(node *yaml.Node) error { return nil } -func (tag *Tag) UnmarshalYAML(node *yaml.Node) error { +// UnmarshalYAML sets T from node. +func (doc *T) UnmarshalYAML(node *yaml.Node) error { + type TBis T + var x TBis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile()) + *doc = T(x) + setChildOriginKeys(node, doc, nativeOriginFile()) + return nil +} + +// UnmarshalYAML sets Tag from node. +func (t *Tag) UnmarshalYAML(node *yaml.Node) error { type TagBis Tag var x TagBis ext, err := decodeStructWithExtensions(node, &x) @@ -325,11 +350,12 @@ func (tag *Tag) UnmarshalYAML(node *yaml.Node) error { } x.Extensions = ext x.Origin = originFromNode(node, nativeOriginFile()) - *tag = Tag(x) - setChildOriginKeys(node, tag, nativeOriginFile()) + *t = Tag(x) + setChildOriginKeys(node, t, nativeOriginFile()) return nil } +// UnmarshalYAML sets XML from node. func (xml *XML) UnmarshalYAML(node *yaml.Node) error { type XMLBis XML var x XMLBis diff --git a/openapi3/nativeyaml.tmpl b/openapi3/nativeyaml.tmpl new file mode 100644 index 000000000..a2904115b --- /dev/null +++ b/openapi3/nativeyaml.tmpl @@ -0,0 +1,27 @@ +// Code generated by go generate using nativeyaml.tmpl; DO NOT EDIT native_yaml_shadow.go. +package {{ .Package }} + +import ( + yaml "go.yaml.in/yaml/v3" +) + +// UnmarshalYAML for the types whose YAML form is a mapping of declared fields +// plus extensions. Each decodes into a shadow type, so the decoder does not +// recurse into this method, collects the keys the struct does not declare, and +// reads the origin off the node. +{{ range $type := .Types }} +// UnmarshalYAML sets {{ $type.Name }} from node. +func ({{ $type.Recv }} *{{ $type.Name }}) UnmarshalYAML(node *yaml.Node) error { + type {{ $type.Name }}Bis {{ $type.Name }} + var x {{ $type.Name }}Bis + ext, err := decodeStructWithExtensions(node, &x) + if err != nil { + return err + } + x.Extensions = ext + x.Origin = originFromNode(node, nativeOriginFile()) + *{{ $type.Recv }} = {{ $type.Name }}(x) + setChildOriginKeys(node, {{ $type.Recv }}, nativeOriginFile()) + return nil +} +{{ end -}} diff --git a/openapi3/nativeyamlgenerator.go b/openapi3/nativeyamlgenerator.go new file mode 100644 index 000000000..5cf4e9227 --- /dev/null +++ b/openapi3/nativeyamlgenerator.go @@ -0,0 +1,72 @@ +//go:build ignore + +// The program generates native_yaml_shadow.go, invoke `go generate ./...` to run. +package main + +import ( + "bytes" + _ "embed" + "go/format" + "os" + "text/template" +) + +//go:embed nativeyaml.tmpl +var tmplData string + +type shadowType struct { + Name string + Recv string +} + +func main() { + // The types whose YAML form is a mapping of declared fields plus + // extensions. The $ref wrappers are generated from refs.tmpl instead, and + // the maplike collections and union-typed values are hand-written in + // native_yaml_special.go because they do not share this shape. + types := []shadowType{ + {"Components", "components"}, + {"Contact", "contact"}, + {"Discriminator", "discriminator"}, + {"Encoding", "encoding"}, + {"Example", "example"}, + {"ExternalDocs", "e"}, + {"Info", "info"}, + {"License", "license"}, + {"Link", "link"}, + {"MediaType", "mediaType"}, + {"OAuthFlow", "flow"}, + {"OAuthFlows", "flows"}, + {"Operation", "operation"}, + {"Parameter", "parameter"}, + {"PathItem", "pathItem"}, + {"RequestBody", "requestBody"}, + {"Response", "response"}, + {"Schema", "schema"}, + {"SecurityScheme", "ss"}, + {"Server", "server"}, + {"ServerVariable", "serverVariable"}, + {"T", "doc"}, + {"Tag", "t"}, + {"XML", "xml"}, + } + + tmpl := template.Must(template.New("nativeyaml").Parse(tmplData)) + buf := new(bytes.Buffer) + if err := tmpl.Execute(buf, struct { + Package string + Types []shadowType + }{ + Package: os.Getenv("GOPACKAGE"), // set by the go:generate directive + Types: types, + }); err != nil { + panic(err) + } + src, err := format.Source(buf.Bytes()) + if err != nil { + panic(err) + } + if err := os.WriteFile("native_yaml_shadow.go", src, 0o644); err != nil { + panic(err) + } +} diff --git a/openapi3/refs.go b/openapi3/refs.go index c04d30551..0dd322d3e 100644 --- a/openapi3/refs.go +++ b/openapi3/refs.go @@ -8,6 +8,7 @@ import ( "strings" "github.com/go-openapi/jsonpointer" + yaml "go.yaml.in/yaml/v3" ) // CallbackRef represents either a Callback or a $ref to a Callback. @@ -73,6 +74,15 @@ func (x CallbackRef) MarshalJSON() ([]byte, error) { return json.Marshal(y) } +// UnmarshalYAML sets CallbackRef from node. +func (x *CallbackRef) UnmarshalYAML(node *yaml.Node) error { + x.Origin = originFromNode(node, nativeOriginFile()) + if !unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { + return node.Decode(&x.Value) + } + return nil +} + // UnmarshalJSON sets CallbackRef to a copy of data. func (x *CallbackRef) UnmarshalJSON(data []byte) error { var refOnly Ref @@ -235,6 +245,15 @@ func (x ExampleRef) MarshalJSON() ([]byte, error) { return json.Marshal(y) } +// UnmarshalYAML sets ExampleRef from node. +func (x *ExampleRef) UnmarshalYAML(node *yaml.Node) error { + x.Origin = originFromNode(node, nativeOriginFile()) + if !unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { + return node.Decode(&x.Value) + } + return nil +} + // UnmarshalJSON sets ExampleRef to a copy of data. func (x *ExampleRef) UnmarshalJSON(data []byte) error { var refOnly Ref @@ -397,6 +416,15 @@ func (x HeaderRef) MarshalJSON() ([]byte, error) { return json.Marshal(y) } +// UnmarshalYAML sets HeaderRef from node. +func (x *HeaderRef) UnmarshalYAML(node *yaml.Node) error { + x.Origin = originFromNode(node, nativeOriginFile()) + if !unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { + return node.Decode(&x.Value) + } + return nil +} + // UnmarshalJSON sets HeaderRef to a copy of data. func (x *HeaderRef) UnmarshalJSON(data []byte) error { var refOnly Ref @@ -559,6 +587,15 @@ func (x LinkRef) MarshalJSON() ([]byte, error) { return json.Marshal(y) } +// UnmarshalYAML sets LinkRef from node. +func (x *LinkRef) UnmarshalYAML(node *yaml.Node) error { + x.Origin = originFromNode(node, nativeOriginFile()) + if !unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { + return node.Decode(&x.Value) + } + return nil +} + // UnmarshalJSON sets LinkRef to a copy of data. func (x *LinkRef) UnmarshalJSON(data []byte) error { var refOnly Ref @@ -721,6 +758,15 @@ func (x ParameterRef) MarshalJSON() ([]byte, error) { return json.Marshal(y) } +// UnmarshalYAML sets ParameterRef from node. +func (x *ParameterRef) UnmarshalYAML(node *yaml.Node) error { + x.Origin = originFromNode(node, nativeOriginFile()) + if !unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { + return node.Decode(&x.Value) + } + return nil +} + // UnmarshalJSON sets ParameterRef to a copy of data. func (x *ParameterRef) UnmarshalJSON(data []byte) error { var refOnly Ref @@ -883,6 +929,15 @@ func (x RequestBodyRef) MarshalJSON() ([]byte, error) { return json.Marshal(y) } +// UnmarshalYAML sets RequestBodyRef from node. +func (x *RequestBodyRef) UnmarshalYAML(node *yaml.Node) error { + x.Origin = originFromNode(node, nativeOriginFile()) + if !unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { + return node.Decode(&x.Value) + } + return nil +} + // UnmarshalJSON sets RequestBodyRef to a copy of data. func (x *RequestBodyRef) UnmarshalJSON(data []byte) error { var refOnly Ref @@ -1045,6 +1100,15 @@ func (x ResponseRef) MarshalJSON() ([]byte, error) { return json.Marshal(y) } +// UnmarshalYAML sets ResponseRef from node. +func (x *ResponseRef) UnmarshalYAML(node *yaml.Node) error { + x.Origin = originFromNode(node, nativeOriginFile()) + if !unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { + return node.Decode(&x.Value) + } + return nil +} + // UnmarshalJSON sets ResponseRef to a copy of data. func (x *ResponseRef) UnmarshalJSON(data []byte) error { var refOnly Ref @@ -1205,6 +1269,33 @@ func (x SchemaRef) MarshalJSON() ([]byte, error) { return json.Marshal(y) } +// UnmarshalYAML sets SchemaRef from node. +func (x *SchemaRef) UnmarshalYAML(node *yaml.Node) error { + x.Origin = originFromNode(node, nativeOriginFile()) + if !unmarshalRefYAML(node, &x.Ref, nil, nil, &x.Extensions) { + return node.Decode(&x.Value) + } + // OAS 3.1 / JSON Schema 2020-12: schema keywords alongside a $ref are valid + // and are merged with the resolved reference, so they are held on sibling + // until resolveSchemaRef can apply them. + var hasSiblings bool + for i := 0; i+1 < len(node.Content); i += 2 { + if k := node.Content[i].Value; k != "$ref" { + x.extra = append(x.extra, k) + if !strings.HasPrefix(k, "x-") { + hasSiblings = true + } + } + } + if hasSiblings { + var sibling Schema + if err := node.Decode(&sibling); err == nil { + x.sibling = &sibling + } + } + return nil +} + // UnmarshalJSON sets SchemaRef to a copy of data. func (x *SchemaRef) UnmarshalJSON(data []byte) error { var refOnly Ref @@ -1373,6 +1464,15 @@ func (x SecuritySchemeRef) MarshalJSON() ([]byte, error) { return json.Marshal(y) } +// UnmarshalYAML sets SecuritySchemeRef from node. +func (x *SecuritySchemeRef) UnmarshalYAML(node *yaml.Node) error { + x.Origin = originFromNode(node, nativeOriginFile()) + if !unmarshalRefYAML(node, &x.Ref, &x.Summary, &x.Description, &x.Extensions) { + return node.Decode(&x.Value) + } + return nil +} + // UnmarshalJSON sets SecuritySchemeRef to a copy of data. func (x *SecuritySchemeRef) UnmarshalJSON(data []byte) error { var refOnly Ref diff --git a/openapi3/refs.tmpl b/openapi3/refs.tmpl index 1b20b4481..6ea0f0de8 100644 --- a/openapi3/refs.tmpl +++ b/openapi3/refs.tmpl @@ -8,6 +8,7 @@ import ( "strings" "github.com/go-openapi/jsonpointer" + yaml "go.yaml.in/yaml/v3" ) {{ range $type := .Types }} // {{ $type.Name }}Ref represents either a {{ $type.Name }} or a $ref to a {{ $type.Name }}. @@ -83,6 +84,35 @@ func (x {{ $type.Name }}Ref) MarshalJSON() ([]byte, error) { return json.Marshal(y) } +// UnmarshalYAML sets {{ $type.Name }}Ref from node. +func (x *{{ $type.Name }}Ref) UnmarshalYAML(node *yaml.Node) error { + x.Origin = originFromNode(node, nativeOriginFile()) + if !unmarshalRefYAML(node, &x.Ref{{ if ne $type.Name "Schema" }}, &x.Summary, &x.Description{{ else }}, nil, nil{{ end }}, &x.Extensions) { + return node.Decode(&x.Value) + } +{{- if eq $type.Name "Schema" }} + // OAS 3.1 / JSON Schema 2020-12: schema keywords alongside a $ref are valid + // and are merged with the resolved reference, so they are held on sibling + // until resolveSchemaRef can apply them. + var hasSiblings bool + for i := 0; i+1 < len(node.Content); i += 2 { + if k := node.Content[i].Value; k != "$ref" { + x.extra = append(x.extra, k) + if !strings.HasPrefix(k, "x-") { + hasSiblings = true + } + } + } + if hasSiblings { + var sibling Schema + if err := node.Decode(&sibling); err == nil { + x.sibling = &sibling + } + } +{{- end }} + return nil +} + // UnmarshalJSON sets {{ $type.Name }}Ref to a copy of data. func (x *{{ $type.Name }}Ref) UnmarshalJSON(data []byte) error { var refOnly Ref From 9fad1ec06cc89aab66c17d5db22ea39abd4f444d Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 15:02:08 +0300 Subject: [PATCH 12/31] Use a generic helper in the generated UnmarshalYAML bodies I claimed generics could not help here because the shadow type that stops the decoder recursing cannot come from a type parameter. That is true, but it does not follow that the whole body has to be written per type: the shadow can be declared locally and the receiver converted to it, which decodes in place, leaving only the two fields the decoder skips to be set. decodeMapping takes it from there. Bodies drop from twelve lines to six, and the generated file from 371 lines to 301. Keeping the generator rather than hand-writing the six-line methods, because the body will change again -- origin coverage is still incomplete -- and 24 copies that must move together are what a template is for. Size is close either way (399 against 171); lockstep is the reason to prefer this one. Behaviour is unchanged: same 23 failures before and after, and a probe comparing the two forms on the same document agreed on content, extensions and origin. --- openapi3/native_yaml.go | 7 + openapi3/native_yaml_shadow.go | 224 ++++++------------ openapi3/nativeyaml.tmpl | 17 +- ...o_sync_for_commerce_1_1_openapi_yaml__load | 2 +- ...c_for_expenses_prealpha_openapi_yaml__load | 2 +- .../vercel_com_0_0_1_openapi_yaml__load | 2 +- 6 files changed, 95 insertions(+), 159 deletions(-) diff --git a/openapi3/native_yaml.go b/openapi3/native_yaml.go index 13d8e7039..c97a80074 100644 --- a/openapi3/native_yaml.go +++ b/openapi3/native_yaml.go @@ -68,6 +68,13 @@ func knownYAMLFields(t reflect.Type) map[string]struct{} { return known } +// decodeMapping decodes node into a method-less view of the target, supplied by +// the caller as a locally-declared shadow type, and returns the keys the target +// does not declare. +func decodeMapping[S any](node *yaml.Node, shadow *S) (map[string]any, error) { + return decodeStructWithExtensions(node, shadow) +} + // decodeStructWithExtensions decodes node into out and returns the mapping keys // out does not declare, which are the extensions. Returns nil rather than an // empty map when there are none. diff --git a/openapi3/native_yaml_shadow.go b/openapi3/native_yaml_shadow.go index ec24b1d51..8363326d2 100644 --- a/openapi3/native_yaml_shadow.go +++ b/openapi3/native_yaml_shadow.go @@ -6,366 +6,296 @@ import ( ) // UnmarshalYAML for the types whose YAML form is a mapping of declared fields -// plus extensions. Each decodes into a shadow type, so the decoder does not -// recurse into this method, collects the keys the struct does not declare, and -// reads the origin off the node. +// plus extensions. +// +// The local shadow type is what stops the decoder recursing into this method; +// converting the receiver to it decodes in place, so only the two fields the +// decoder skips are set afterwards. Everything else is in decodeMapping. // UnmarshalYAML sets Components from node. func (components *Components) UnmarshalYAML(node *yaml.Node) error { - type ComponentsBis Components - var x ComponentsBis - ext, err := decodeStructWithExtensions(node, &x) + type bis Components + ext, err := decodeMapping(node, (*bis)(components)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *components = Components(x) + components.Extensions, components.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, components, nativeOriginFile()) return nil } // UnmarshalYAML sets Contact from node. func (contact *Contact) UnmarshalYAML(node *yaml.Node) error { - type ContactBis Contact - var x ContactBis - ext, err := decodeStructWithExtensions(node, &x) + type bis Contact + ext, err := decodeMapping(node, (*bis)(contact)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *contact = Contact(x) + contact.Extensions, contact.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, contact, nativeOriginFile()) return nil } // UnmarshalYAML sets Discriminator from node. func (discriminator *Discriminator) UnmarshalYAML(node *yaml.Node) error { - type DiscriminatorBis Discriminator - var x DiscriminatorBis - ext, err := decodeStructWithExtensions(node, &x) + type bis Discriminator + ext, err := decodeMapping(node, (*bis)(discriminator)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *discriminator = Discriminator(x) + discriminator.Extensions, discriminator.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, discriminator, nativeOriginFile()) return nil } // UnmarshalYAML sets Encoding from node. func (encoding *Encoding) UnmarshalYAML(node *yaml.Node) error { - type EncodingBis Encoding - var x EncodingBis - ext, err := decodeStructWithExtensions(node, &x) + type bis Encoding + ext, err := decodeMapping(node, (*bis)(encoding)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *encoding = Encoding(x) + encoding.Extensions, encoding.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, encoding, nativeOriginFile()) return nil } // UnmarshalYAML sets Example from node. func (example *Example) UnmarshalYAML(node *yaml.Node) error { - type ExampleBis Example - var x ExampleBis - ext, err := decodeStructWithExtensions(node, &x) + type bis Example + ext, err := decodeMapping(node, (*bis)(example)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *example = Example(x) + example.Extensions, example.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, example, nativeOriginFile()) return nil } // UnmarshalYAML sets ExternalDocs from node. func (e *ExternalDocs) UnmarshalYAML(node *yaml.Node) error { - type ExternalDocsBis ExternalDocs - var x ExternalDocsBis - ext, err := decodeStructWithExtensions(node, &x) + type bis ExternalDocs + ext, err := decodeMapping(node, (*bis)(e)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *e = ExternalDocs(x) + e.Extensions, e.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, e, nativeOriginFile()) return nil } // UnmarshalYAML sets Info from node. func (info *Info) UnmarshalYAML(node *yaml.Node) error { - type InfoBis Info - var x InfoBis - ext, err := decodeStructWithExtensions(node, &x) + type bis Info + ext, err := decodeMapping(node, (*bis)(info)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *info = Info(x) + info.Extensions, info.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, info, nativeOriginFile()) return nil } // UnmarshalYAML sets License from node. func (license *License) UnmarshalYAML(node *yaml.Node) error { - type LicenseBis License - var x LicenseBis - ext, err := decodeStructWithExtensions(node, &x) + type bis License + ext, err := decodeMapping(node, (*bis)(license)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *license = License(x) + license.Extensions, license.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, license, nativeOriginFile()) return nil } // UnmarshalYAML sets Link from node. func (link *Link) UnmarshalYAML(node *yaml.Node) error { - type LinkBis Link - var x LinkBis - ext, err := decodeStructWithExtensions(node, &x) + type bis Link + ext, err := decodeMapping(node, (*bis)(link)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *link = Link(x) + link.Extensions, link.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, link, nativeOriginFile()) return nil } // UnmarshalYAML sets MediaType from node. func (mediaType *MediaType) UnmarshalYAML(node *yaml.Node) error { - type MediaTypeBis MediaType - var x MediaTypeBis - ext, err := decodeStructWithExtensions(node, &x) + type bis MediaType + ext, err := decodeMapping(node, (*bis)(mediaType)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *mediaType = MediaType(x) + mediaType.Extensions, mediaType.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, mediaType, nativeOriginFile()) return nil } // UnmarshalYAML sets OAuthFlow from node. func (flow *OAuthFlow) UnmarshalYAML(node *yaml.Node) error { - type OAuthFlowBis OAuthFlow - var x OAuthFlowBis - ext, err := decodeStructWithExtensions(node, &x) + type bis OAuthFlow + ext, err := decodeMapping(node, (*bis)(flow)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *flow = OAuthFlow(x) + flow.Extensions, flow.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, flow, nativeOriginFile()) return nil } // UnmarshalYAML sets OAuthFlows from node. func (flows *OAuthFlows) UnmarshalYAML(node *yaml.Node) error { - type OAuthFlowsBis OAuthFlows - var x OAuthFlowsBis - ext, err := decodeStructWithExtensions(node, &x) + type bis OAuthFlows + ext, err := decodeMapping(node, (*bis)(flows)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *flows = OAuthFlows(x) + flows.Extensions, flows.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, flows, nativeOriginFile()) return nil } // UnmarshalYAML sets Operation from node. func (operation *Operation) UnmarshalYAML(node *yaml.Node) error { - type OperationBis Operation - var x OperationBis - ext, err := decodeStructWithExtensions(node, &x) + type bis Operation + ext, err := decodeMapping(node, (*bis)(operation)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *operation = Operation(x) + operation.Extensions, operation.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, operation, nativeOriginFile()) return nil } // UnmarshalYAML sets Parameter from node. func (parameter *Parameter) UnmarshalYAML(node *yaml.Node) error { - type ParameterBis Parameter - var x ParameterBis - ext, err := decodeStructWithExtensions(node, &x) + type bis Parameter + ext, err := decodeMapping(node, (*bis)(parameter)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *parameter = Parameter(x) + parameter.Extensions, parameter.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, parameter, nativeOriginFile()) return nil } // UnmarshalYAML sets PathItem from node. func (pathItem *PathItem) UnmarshalYAML(node *yaml.Node) error { - type PathItemBis PathItem - var x PathItemBis - ext, err := decodeStructWithExtensions(node, &x) + type bis PathItem + ext, err := decodeMapping(node, (*bis)(pathItem)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *pathItem = PathItem(x) + pathItem.Extensions, pathItem.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, pathItem, nativeOriginFile()) return nil } // UnmarshalYAML sets RequestBody from node. func (requestBody *RequestBody) UnmarshalYAML(node *yaml.Node) error { - type RequestBodyBis RequestBody - var x RequestBodyBis - ext, err := decodeStructWithExtensions(node, &x) + type bis RequestBody + ext, err := decodeMapping(node, (*bis)(requestBody)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *requestBody = RequestBody(x) + requestBody.Extensions, requestBody.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, requestBody, nativeOriginFile()) return nil } // UnmarshalYAML sets Response from node. func (response *Response) UnmarshalYAML(node *yaml.Node) error { - type ResponseBis Response - var x ResponseBis - ext, err := decodeStructWithExtensions(node, &x) + type bis Response + ext, err := decodeMapping(node, (*bis)(response)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *response = Response(x) + response.Extensions, response.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, response, nativeOriginFile()) return nil } // UnmarshalYAML sets Schema from node. func (schema *Schema) UnmarshalYAML(node *yaml.Node) error { - type SchemaBis Schema - var x SchemaBis - ext, err := decodeStructWithExtensions(node, &x) + type bis Schema + ext, err := decodeMapping(node, (*bis)(schema)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *schema = Schema(x) + schema.Extensions, schema.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, schema, nativeOriginFile()) return nil } // UnmarshalYAML sets SecurityScheme from node. func (ss *SecurityScheme) UnmarshalYAML(node *yaml.Node) error { - type SecuritySchemeBis SecurityScheme - var x SecuritySchemeBis - ext, err := decodeStructWithExtensions(node, &x) + type bis SecurityScheme + ext, err := decodeMapping(node, (*bis)(ss)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *ss = SecurityScheme(x) + ss.Extensions, ss.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, ss, nativeOriginFile()) return nil } // UnmarshalYAML sets Server from node. func (server *Server) UnmarshalYAML(node *yaml.Node) error { - type ServerBis Server - var x ServerBis - ext, err := decodeStructWithExtensions(node, &x) + type bis Server + ext, err := decodeMapping(node, (*bis)(server)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *server = Server(x) + server.Extensions, server.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, server, nativeOriginFile()) return nil } // UnmarshalYAML sets ServerVariable from node. func (serverVariable *ServerVariable) UnmarshalYAML(node *yaml.Node) error { - type ServerVariableBis ServerVariable - var x ServerVariableBis - ext, err := decodeStructWithExtensions(node, &x) + type bis ServerVariable + ext, err := decodeMapping(node, (*bis)(serverVariable)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *serverVariable = ServerVariable(x) + serverVariable.Extensions, serverVariable.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, serverVariable, nativeOriginFile()) return nil } // UnmarshalYAML sets T from node. func (doc *T) UnmarshalYAML(node *yaml.Node) error { - type TBis T - var x TBis - ext, err := decodeStructWithExtensions(node, &x) + type bis T + ext, err := decodeMapping(node, (*bis)(doc)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *doc = T(x) + doc.Extensions, doc.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, doc, nativeOriginFile()) return nil } // UnmarshalYAML sets Tag from node. func (t *Tag) UnmarshalYAML(node *yaml.Node) error { - type TagBis Tag - var x TagBis - ext, err := decodeStructWithExtensions(node, &x) + type bis Tag + ext, err := decodeMapping(node, (*bis)(t)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *t = Tag(x) + t.Extensions, t.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, t, nativeOriginFile()) return nil } // UnmarshalYAML sets XML from node. func (xml *XML) UnmarshalYAML(node *yaml.Node) error { - type XMLBis XML - var x XMLBis - ext, err := decodeStructWithExtensions(node, &x) + type bis XML + ext, err := decodeMapping(node, (*bis)(xml)) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *xml = XML(x) + xml.Extensions, xml.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, xml, nativeOriginFile()) return nil } diff --git a/openapi3/nativeyaml.tmpl b/openapi3/nativeyaml.tmpl index a2904115b..14c5f0132 100644 --- a/openapi3/nativeyaml.tmpl +++ b/openapi3/nativeyaml.tmpl @@ -6,21 +6,20 @@ import ( ) // UnmarshalYAML for the types whose YAML form is a mapping of declared fields -// plus extensions. Each decodes into a shadow type, so the decoder does not -// recurse into this method, collects the keys the struct does not declare, and -// reads the origin off the node. +// plus extensions. +// +// The local shadow type is what stops the decoder recursing into this method; +// converting the receiver to it decodes in place, so only the two fields the +// decoder skips are set afterwards. Everything else is in decodeMapping. {{ range $type := .Types }} // UnmarshalYAML sets {{ $type.Name }} from node. func ({{ $type.Recv }} *{{ $type.Name }}) UnmarshalYAML(node *yaml.Node) error { - type {{ $type.Name }}Bis {{ $type.Name }} - var x {{ $type.Name }}Bis - ext, err := decodeStructWithExtensions(node, &x) + type bis {{ $type.Name }} + ext, err := decodeMapping(node, (*bis)({{ $type.Recv }})) if err != nil { return err } - x.Extensions = ext - x.Origin = originFromNode(node, nativeOriginFile()) - *{{ $type.Recv }} = {{ $type.Name }}(x) + {{ $type.Recv }}.Extensions, {{ $type.Recv }}.Origin = ext, originFromNode(node, nativeOriginFile()) setChildOriginKeys(node, {{ $type.Recv }}, nativeOriginFile()) return nil } diff --git a/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_commerce_1_1_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_commerce_1_1_openapi_yaml__load index c34de6b50..f3a32347d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_commerce_1_1_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_commerce_1_1_openapi_yaml__load @@ -1,2 +1,2 @@ failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: unmarshal errors: - line 751: cannot unmarshal !!bool `false` into openapi3.SchemaBis + line 751: cannot unmarshal !!bool `false` into openapi3.bis diff --git a/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_expenses_prealpha_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_expenses_prealpha_openapi_yaml__load index 846fbcea7..510fd3030 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_expenses_prealpha_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/codat_io_sync_for_expenses_prealpha_openapi_yaml__load @@ -1,2 +1,2 @@ failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: unmarshal errors: - line 766: cannot unmarshal !!bool `false` into openapi3.SchemaBis + line 766: cannot unmarshal !!bool `false` into openapi3.bis diff --git a/openapi3/testdata/apis_guru_openapi_directory/vercel_com_0_0_1_openapi_yaml__load b/openapi3/testdata/apis_guru_openapi_directory/vercel_com_0_0_1_openapi_yaml__load index 44dd91250..6d0ad8ac2 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vercel_com_0_0_1_openapi_yaml__load +++ b/openapi3/testdata/apis_guru_openapi_directory/vercel_com_0_0_1_openapi_yaml__load @@ -1,2 +1,2 @@ failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: yaml: unmarshal errors: - line 860: cannot unmarshal !!bool `false` into openapi3.SchemaBis + line 860: cannot unmarshal !!bool `false` into openapi3.bis From 0ed2a5ab4a13042b9706ad094f6f574530e890e6 Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 18:47:03 +0300 Subject: [PATCH 13/31] Fix explicit-null responses and arbitrary-key ref origins Two of the four classes of real failure. Operation has to tell an omitted responses from an explicitly null one: the first is allowed from OAS 3.1, the second never is. A null node decodes to an empty Responses, indistinguishable from `{}` without the flag, so Operation moves out of the generated set and checks the node. A $ref to a schema under an arbitrary top-level key resolves through plain extension data, which carries no positions. The loader now retains the parsed node tree rather than an origin tree, and attachOriginToResolved walks it to the fragment and decodes that subtree, which runs its UnmarshalYAML and produces origins natively. Real failures 11 -> 7. The remaining are five origin coverage gaps and one changed error message; separately 13 tests assert end positions, which are unset until the parser records them again. --- .github/docs/openapi3.txt | 5 ++++- openapi3/loader.go | 17 +++++++++++------ openapi3/marsh.go | 11 ++++++++++- openapi3/native_yaml_shadow.go | 12 ------------ openapi3/native_yaml_special.go | 18 ++++++++++++++++++ openapi3/nativeyamlgenerator.go | 8 ++++---- openapi3/origin.go | 3 ++- 7 files changed, 49 insertions(+), 25 deletions(-) diff --git a/.github/docs/openapi3.txt b/.github/docs/openapi3.txt index 39c9cbece..a7097b4c2 100644 --- a/.github/docs/openapi3.txt +++ b/.github/docs/openapi3.txt @@ -1909,7 +1909,10 @@ func (operation *Operation) UnmarshalJSON(data []byte) error UnmarshalJSON sets Operation to a copy of data. func (operation *Operation) UnmarshalYAML(node *yaml.Node) error - UnmarshalYAML sets Operation from node. + Operation distinguishes an omitted responses from an explicitly null one: + the first is allowed in OAS 3.1 and later, the second never is. A null node + decodes to an empty Responses, which is indistinguishable from `{}` without + the flag. func (operation *Operation) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if Operation does not comply with the OpenAPI diff --git a/openapi3/loader.go b/openapi3/loader.go index ce02e46ba..1654b1b6e 100644 --- a/openapi3/loader.go +++ b/openapi3/loader.go @@ -147,8 +147,9 @@ func (loader *Loader) loadSingleElementFromURI(ref string, rootPath *url.URL, el return resolvedPath, nil } -// rememberOriginTree retains doc's origin tree for attachOriginToResolved. -// tree is nil when IncludeOrigin is off or the data took the json path. +// rememberOriginTree retains doc's parsed node tree for +// attachOriginToResolved. tree is nil when origins are off or the data took +// the json path. func (loader *Loader) rememberOriginTree(doc *T, tree *originTree) { if tree == nil { return @@ -564,19 +565,23 @@ func (loader *Loader) attachOriginToResolved(resolved any, componentDoc *T, frag if !loader.IncludeOrigin { return } - tree := loader.originTrees[componentDoc] - if tree == nil { + node := loader.originTrees[componentDoc] + if node == nil { return } + // Walk the retained node tree down to the fragment and decode that subtree + // into the resolved value, which runs its UnmarshalYAML and so produces + // origins. The generic-map resolution path that produced `resolved` has + // none, because an extension value decodes as plain data. for part := range strings.SplitSeq(strings.Trim(fragment, "/"), "/") { if part == "" { continue } - if tree = tree.Fields[unescapeRefString(part)]; tree == nil { + if node = mappingValue(node, unescapeRefString(part)); node == nil { return } } - applyOrigins(resolved, tree) + _ = node.Decode(resolved) } func readableType(x any) string { diff --git a/openapi3/marsh.go b/openapi3/marsh.go index 849ace909..7f4db28ab 100644 --- a/openapi3/marsh.go +++ b/openapi3/marsh.go @@ -36,7 +36,16 @@ func unmarshal(data []byte, v any, includeOrigin bool, location *url.URL) (*orig if err := goyaml.Unmarshal(data, &root); err == nil { stripTimestamps(&root) if err = root.Decode(v); err == nil { - return nil, nil + if !includeOrigin { + return nil, nil + } + // Retained so a $ref to an arbitrary top-level key can be decoded + // from its own node; that path resolves through plain data, which + // carries no positions. + if root.Kind == goyaml.DocumentNode && len(root.Content) > 0 { + return root.Content[0], nil + } + return &root, nil } yamlErr = err } else { diff --git a/openapi3/native_yaml_shadow.go b/openapi3/native_yaml_shadow.go index 8363326d2..6394064d7 100644 --- a/openapi3/native_yaml_shadow.go +++ b/openapi3/native_yaml_shadow.go @@ -156,18 +156,6 @@ func (flows *OAuthFlows) UnmarshalYAML(node *yaml.Node) error { return nil } -// UnmarshalYAML sets Operation from node. -func (operation *Operation) UnmarshalYAML(node *yaml.Node) error { - type bis Operation - ext, err := decodeMapping(node, (*bis)(operation)) - if err != nil { - return err - } - operation.Extensions, operation.Origin = ext, originFromNode(node, nativeOriginFile()) - setChildOriginKeys(node, operation, nativeOriginFile()) - return nil -} - // UnmarshalYAML sets Parameter from node. func (parameter *Parameter) UnmarshalYAML(node *yaml.Node) error { type bis Parameter diff --git a/openapi3/native_yaml_special.go b/openapi3/native_yaml_special.go index ab582805d..0def5c7ac 100644 --- a/openapi3/native_yaml_special.go +++ b/openapi3/native_yaml_special.go @@ -124,3 +124,21 @@ func (eb *ExclusiveBound) UnmarshalYAML(node *yaml.Node) error { eb.Value = &f return nil } + +// Operation distinguishes an omitted responses from an explicitly null one: +// the first is allowed in OAS 3.1 and later, the second never is. A null node +// decodes to an empty Responses, which is indistinguishable from `{}` without +// the flag. +func (operation *Operation) UnmarshalYAML(node *yaml.Node) error { + type bis Operation + ext, err := decodeMapping(node, (*bis)(operation)) + if err != nil { + return err + } + operation.Extensions, operation.Origin = ext, originFromNode(node, nativeOriginFile()) + if v := mappingValue(node, "responses"); v != nil && v.Tag == "!!null" { + operation.Responses = &Responses{explicitlyNull: true} + } + setChildOriginKeys(node, operation, nativeOriginFile()) + return nil +} diff --git a/openapi3/nativeyamlgenerator.go b/openapi3/nativeyamlgenerator.go index 5cf4e9227..f2745a269 100644 --- a/openapi3/nativeyamlgenerator.go +++ b/openapi3/nativeyamlgenerator.go @@ -21,9 +21,10 @@ type shadowType struct { func main() { // The types whose YAML form is a mapping of declared fields plus - // extensions. The $ref wrappers are generated from refs.tmpl instead, and - // the maplike collections and union-typed values are hand-written in - // native_yaml_special.go because they do not share this shape. + // extensions. The $ref wrappers are generated from refs.tmpl instead. + // Hand-written in native_yaml_special.go: the maplike collections, the + // union-typed values, and Operation, which has to tell an omitted + // responses from an explicitly null one. types := []shadowType{ {"Components", "components"}, {"Contact", "contact"}, @@ -37,7 +38,6 @@ func main() { {"MediaType", "mediaType"}, {"OAuthFlow", "flow"}, {"OAuthFlows", "flows"}, - {"Operation", "operation"}, {"Parameter", "parameter"}, {"PathItem", "pathItem"}, {"RequestBody", "requestBody"}, diff --git a/openapi3/origin.go b/openapi3/origin.go index b571cb3d2..4ace4ce26 100644 --- a/openapi3/origin.go +++ b/openapi3/origin.go @@ -6,6 +6,7 @@ import ( "strings" "github.com/oasdiff/yaml" + goyaml "go.yaml.in/yaml/v3" ) var originPtrType = reflect.TypeFor[*Origin]() @@ -327,4 +328,4 @@ func jsonTagName(f reflect.StructField) string { // originTree aliases the decoder-side origin tree, so the loader and marsh can // carry it without referencing the yaml package directly. -type originTree = yaml.OriginTree +type originTree = goyaml.Node From d5e60c517c92fe847929384c1efc8d604cd35fb4 Mon Sep 17 00:00:00 2001 From: Pierre Fenoll Date: Mon, 3 Aug 2026 17:48:31 +0200 Subject: [PATCH 14/31] openapi3filter: fix for CI (#1237) Signed-off-by: Pierre Fenoll --- openapi3filter/ghsa_74vm_87hj_r66f_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openapi3filter/ghsa_74vm_87hj_r66f_test.go b/openapi3filter/ghsa_74vm_87hj_r66f_test.go index d47f1caba..ffb888dd3 100644 --- a/openapi3filter/ghsa_74vm_87hj_r66f_test.go +++ b/openapi3filter/ghsa_74vm_87hj_r66f_test.go @@ -44,7 +44,8 @@ paths: func validatedInput(t *testing.T, spec string, hdr http.Header) *openapi3filter.ResponseValidationInput { t.Helper() - doc, err := openapi3.NewLoader().LoadFromData([]byte(spec)) + loader := openapi3.NewLoader() + doc, err := loader.LoadFromData([]byte(spec)) require.NoError(t, err) err = doc.Validate(t.Context()) require.NoError(t, err) From fe4d402f66c664e3bac2ddfcaa0b273dd2e6db39 Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 19:09:05 +0300 Subject: [PATCH 15/31] Give any-typed values JSON-shaped numbers The remaining scalar divergence. Comparing the two decode paths across YAML's scalar forms, the differences were narrower than feared: integers old float64, new int -- every notation (42, 0x2A, 4_2) .inf/.nan old errored, new accepts timestamps handled already map keys old coerced 18_24 to "1824"; new keeps the text The last is the previous path being wrong, and is why a fixture asserting `map key "18_24" not found` disappeared: the lookup now succeeds. Fixed the integer one, since a consumer's type switch should not depend on how a number was written. Applied to any-typed values only: extension values, and the any fields the decoder fills directly. Not by retagging the nodes, which was the obvious approach and is wrong. Retagging !!int as !!float does give float64 in an any, but it also routes declared integer fields through float64, and 9007199254740993 comes back as ...992. The previous path preserved those, so a blanket retag would have traded one divergence for a worse one. .inf and .nan are left accepted. They cannot be represented in JSON, so the old path failed to load such a document at all; loading it is not obviously worse, and a beta is the right place to find out. --- openapi3/native_scalars_test.go | 79 +++++++ openapi3/native_yaml.go | 52 ++++- .../bigredcloud_com_v1_openapi_yaml__validate | 16 +- ...a_holidays_ca_1_8_0_openapi_yaml__validate | 26 +++ ...dataflowkit_com_1_3_openapi_yaml__validate | 44 +++- .../dodo_ac_1_6_0_openapi_yaml__validate | 39 ++-- ...dracoon_team_4_42_3_openapi_yaml__validate | 13 +- .../exavault_com_2_0_openapi_yaml__validate | 15 +- ...c_ca_geocoder_2_0_0_openapi_yaml__validate | 19 ++ ...bc_ca_geomark_4_1_2_openapi_yaml__validate | 20 ++ ...ca_jobposting_1_0_0_openapi_yaml__validate | 2 +- ..._bc_ca_router_2_0_0_openapi_yaml__validate | 19 ++ ...ndhog_day_com_1_2_1_openapi_yaml__validate | 32 +++ .../mbus_local_0_3_5_openapi_yaml__validate | 19 +- .../meraki_com_1_32_0_openapi_yaml__validate | 13 ++ .../mineskin_org_1_0_0_openapi_yaml__validate | 14 ++ ...umber_insight_1_2_1_openapi_yaml__validate | 17 +- ..._com_numbers_1_0_20_openapi_yaml__validate | 14 ++ ...s_com_geo_api_1_0_0_openapi_yaml__validate | 13 ++ ...andascore_co_2_23_1_openapi_yaml__validate | 204 +++++++++++++++++- ...pdfblocks_com_1_5_0_openapi_yaml__validate | 20 ++ ...eratorapi_com_3_1_1_openapi_yaml__validate | 15 +- .../slmonitor_com_2_1_openapi_yaml__validate | 18 ++ .../sms77_io_1_0_0_openapi_yaml__validate | 12 +- ...mtom_com_maps_1_0_0_openapi_yaml__validate | 29 +++ ...sight_local_11_1_00_openapi_yaml__validate | 15 ++ .../viator_com_1_0_0_openapi_yaml__validate | 28 +++ ...ge_Center_API_1_0_0_openapi_yaml__validate | 11 + ...es_System_API_1_0_0_openapi_yaml__validate | 126 +---------- .../zoom_us_2_0_0_openapi_yaml__validate | 59 ++--- 30 files changed, 782 insertions(+), 221 deletions(-) create mode 100644 openapi3/native_scalars_test.go create mode 100644 openapi3/testdata/apis_guru_openapi_directory/canada_holidays_ca_1_8_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_geocoder_2_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_geomark_4_1_2_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_router_2_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/groundhog_day_com_1_2_1_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/meraki_com_1_32_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/mineskin_org_1_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/nexmo_com_numbers_1_0_20_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/nytimes_com_geo_api_1_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/pdfblocks_com_1_5_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/slmonitor_com_2_1_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/tomtom_com_maps_1_0_0_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/truesight_local_11_1_00_openapi_yaml__validate create mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_Message_Center_API_1_0_0_openapi_yaml__validate diff --git a/openapi3/native_scalars_test.go b/openapi3/native_scalars_test.go new file mode 100644 index 000000000..8aa875361 --- /dev/null +++ b/openapi3/native_scalars_test.go @@ -0,0 +1,79 @@ +package openapi3 + +import ( + "testing" + + "github.com/stretchr/testify/require" + goyaml "go.yaml.in/yaml/v3" +) + +// YAML resolves more scalar forms than JSON does, so a value reaching an +// any-typed field must not carry a type that depends on its notation. +func TestNativeScalars_AnyValuesAreJSONShaped(t *testing.T) { + const src = ` +type: object +x-dec: 42 +x-hex: 0x2A +x-underscore: 4_2 +x-float: 1.5 +x-str: "42" +x-bool: true +x-nested: {n: 7, list: [1, 2]} +example: 42 +default: 0x10 +` + var node goyaml.Node + require.NoError(t, goyaml.Unmarshal([]byte(src), &node)) + stripTimestamps(&node) + + var s Schema + require.NoError(t, node.Content[0].Decode(&s)) + + // Every integer notation lands as float64, as it would through JSON. + for _, k := range []string{"x-dec", "x-hex", "x-underscore", "x-float"} { + require.IsType(t, float64(0), s.Extensions[k], "%s", k) + } + require.EqualValues(t, 42, s.Extensions["x-dec"]) + require.EqualValues(t, 42, s.Extensions["x-hex"], "hex resolves to its value, not its text") + require.EqualValues(t, 42, s.Extensions["x-underscore"]) + + // Other types are untouched. + require.Equal(t, "42", s.Extensions["x-str"]) + require.Equal(t, true, s.Extensions["x-bool"]) + + // Nested maps and lists too. + n := s.Extensions["x-nested"].(map[string]any) + require.IsType(t, float64(0), n["n"]) + require.IsType(t, float64(0), n["list"].([]any)[0]) + + // The any-typed struct fields the decoder fills directly. + require.IsType(t, float64(0), s.Example) + require.IsType(t, float64(0), s.Default) + require.EqualValues(t, 16, s.Default) +} + +// A declared integer field keeps its own type and full range: normalising +// those too would cost precision beyond 2^53, which the previous decode path +// did not. +func TestNativeScalars_DeclaredIntegerFieldsKeepPrecision(t *testing.T) { + const src = "type: integer\nmaxLength: 9007199254740993\n" + var node goyaml.Node + require.NoError(t, goyaml.Unmarshal([]byte(src), &node)) + + var s Schema + require.NoError(t, node.Content[0].Decode(&s)) + require.NotNil(t, s.MaxLength) + require.Equal(t, uint64(9007199254740993), *s.MaxLength, "must not round-trip through float64") +} + +// Date-shaped scalars stay strings; an explicit tag still asks for a time. +func TestNativeScalars_Timestamps(t *testing.T) { + const src = "example: 2020-06-11T16:32:50Z\n" + var node goyaml.Node + require.NoError(t, goyaml.Unmarshal([]byte(src), &node)) + stripTimestamps(&node) + + var s Schema + require.NoError(t, node.Content[0].Decode(&s)) + require.IsType(t, "", s.Example, "a date-shaped example stays a string") +} diff --git a/openapi3/native_yaml.go b/openapi3/native_yaml.go index c97a80074..8264af5e7 100644 --- a/openapi3/native_yaml.go +++ b/openapi3/native_yaml.go @@ -68,6 +68,55 @@ func knownYAMLFields(t reflect.Type) map[string]struct{} { return known } +// normalizeNumbers converts integers to float64 inside a decoded any. +// +// JSON has one number type, so a value reaching an any-typed field carries a +// float64 whichever notation the source used. YAML resolves 42, 0x2A and 4_2 +// to an int, which would make a consumer's type switch depend on notation. +// +// Applied only to any-typed values. A declared integer field keeps its own +// type and its full range, which a blanket conversion would cost beyond 2^53. +func normalizeNumbers(v any) any { + switch t := v.(type) { + case int: + return float64(t) + case int64: + return float64(t) + case uint64: + return float64(t) + case map[string]any: + for k, e := range t { + t[k] = normalizeNumbers(e) + } + case []any: + for i, e := range t { + t[i] = normalizeNumbers(e) + } + } + return v +} + +// normalizeAnyFields applies normalizeNumbers to a struct's any-typed fields, +// which the decoder fills directly (Example, Default and the like). +func normalizeAnyFields(out any) { + v := reflect.ValueOf(out) + for v.Kind() == reflect.Pointer { + if v.IsNil() { + return + } + v = v.Elem() + } + if v.Kind() != reflect.Struct { + return + } + for i := range v.NumField() { + f := v.Field(i) + if f.Kind() == reflect.Interface && f.CanSet() && !f.IsNil() { + f.Set(reflect.ValueOf(normalizeNumbers(f.Interface()))) + } + } +} + // decodeMapping decodes node into a method-less view of the target, supplied by // the caller as a locally-declared shadow type, and returns the keys the target // does not declare. @@ -103,8 +152,9 @@ func decodeStructWithExtensions(node *yaml.Node, out any) (map[string]any, error if ext == nil { ext = make(map[string]any) } - ext[key] = v + ext[key] = normalizeNumbers(v) } + normalizeAnyFields(out) return ext, nil } diff --git a/openapi3/testdata/apis_guru_openapi_directory/bigredcloud_com_v1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/bigredcloud_com_v1_openapi_yaml__validate index ecf6ae60c..805d03053 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/bigredcloud_com_v1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/bigredcloud_com_v1_openapi_yaml__validate @@ -1 +1,15 @@ -invalid components: schema "BatchItem_CashPaymentDto_": invalid example: Error at "/entryDate": string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" | Error at "/procDate": string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" +invalid components: schema "BatchItem_BankAccountDto_": invalid example: Error at "/opCode": value is not one of the allowed values [1,2,3] +Schema: + { + "description": "1 - Create\r\n2 - Update\r\n3 - Delete", + "enum": [ + 1, + 2, + 3 + ], + "format": "int32", + "type": "integer" + } + +Value: + 1 diff --git a/openapi3/testdata/apis_guru_openapi_directory/canada_holidays_ca_1_8_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/canada_holidays_ca_1_8_0_openapi_yaml__validate new file mode 100644 index 000000000..a039ec5a6 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/canada_holidays_ca_1_8_0_openapi_yaml__validate @@ -0,0 +1,26 @@ +invalid paths: invalid path /api/v1/holidays: invalid operation GET: invalid example: example /holidays: Error at "/holidays/0/federal": value is not one of the allowed values [1,0] +Schema: + { + "description": "Whether this holiday is observed by federally-regulated industries.", + "enum": [ + 1, + 0 + ], + "type": "integer" + } + +Value: + 1 + | Error at "/holidays/1/federal": value is not one of the allowed values [1,0] +Schema: + { + "description": "Whether this holiday is observed by federally-regulated industries.", + "enum": [ + 1, + 0 + ], + "type": "integer" + } + +Value: + 0 diff --git a/openapi3/testdata/apis_guru_openapi_directory/dataflowkit_com_1_3_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/dataflowkit_com_1_3_openapi_yaml__validate index e93714ed7..e4f9dd9c2 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/dataflowkit_com_1_3_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/dataflowkit_com_1_3_openapi_yaml__validate @@ -1,4 +1,46 @@ -invalid components: schema "field": invalid allOf element: invalid example: Error at "/proxy": property "proxy" is missing +invalid components: schema "field": invalid allOf element: invalid example: Error at "/fields/0/type": value is not one of the allowed values [0,1,2] +Schema: + { + "description": "Selector type. ( 0 - image, 1 - text, 2 - link)", + "enum": [ + 0, + 1, + 2 + ], + "type": "integer" + } + +Value: + 1 + | Error at "/fields/1/type": value is not one of the allowed values [0,1,2] +Schema: + { + "description": "Selector type. ( 0 - image, 1 - text, 2 - link)", + "enum": [ + 0, + 1, + 2 + ], + "type": "integer" + } + +Value: + 2 + | Error at "/fields/2/type": value is not one of the allowed values [0,1,2] +Schema: + { + "description": "Selector type. ( 0 - image, 1 - text, 2 - link)", + "enum": [ + 0, + 1, + 2 + ], + "type": "integer" + } + +Value: + 0 + | Error at "/proxy": property "proxy" is missing Schema: { "example": { diff --git a/openapi3/testdata/apis_guru_openapi_directory/dodo_ac_1_6_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/dodo_ac_1_6_0_openapi_yaml__validate index 60805961a..cc9030521 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/dodo_ac_1_6_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/dodo_ac_1_6_0_openapi_yaml__validate @@ -1,32 +1,21 @@ -invalid components: schema "NHInterior": invalid example: value is not one of the allowed values ["Aqua","Beige","Black","Blue","Brown","Colorful","Gray","Green","Orange","Pink","Purple","Red","White","Yellow"] +invalid components: schema "NHClothing": invalid example: value is not one of the allowed values [0,1,2,3,4,5,6,7,8] Schema: { - "description": "(WIP)", + "description": "The total number of variations the clothing has, between 0 and 8.", "enum": [ - "Aqua", - "Beige", - "Black", - "Blue", - "Brown", - "Colorful", - "Gray", - "Green", - "Orange", - "Pink", - "Purple", - "Red", - "White", - "Yellow" + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8 ], - "example": [ - "White", - "Colorful" - ], - "type": "string" + "example": 2, + "type": "integer" } Value: - [ - "White", - "Colorful" - ] + 2 diff --git a/openapi3/testdata/apis_guru_openapi_directory/dracoon_team_4_42_3_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/dracoon_team_4_42_3_openapi_yaml__validate index 238b2c433..f6c884b87 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/dracoon_team_4_42_3_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/dracoon_team_4_42_3_openapi_yaml__validate @@ -1,10 +1,17 @@ -invalid paths: invalid path /v4/auth/login: invalid operation POST: invalid example: example null: Error at "/errorCode": Value is not nullable +invalid components: schema "ConfigRoomRequest": invalid default: value is not one of the allowed values [1,2,3,4] Schema: { - "description": "Internal error code", + "default": 2, + "description": "Classification ID:\n\n* `1` - public\n\n* `2` - internal\n\n* `3` - confidential\n\n* `4` - strictly confidential\n\n\n\nProvided (or default) classification is taken from room\n\nwhen file gets uploaded without any classification.", + "enum": [ + 1, + 2, + 3, + 4 + ], "format": "int32", "type": "integer" } Value: - null + 2 diff --git a/openapi3/testdata/apis_guru_openapi_directory/exavault_com_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/exavault_com_2_0_openapi_yaml__validate index d02359ba1..9698b2977 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/exavault_com_2_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/exavault_com_2_0_openapi_yaml__validate @@ -1,10 +1,15 @@ -invalid components: schema "Error": invalid example: value must be an object +invalid components: schema "Account": invalid example: value is not one of the allowed values [1,0] Schema: { - "description": "Meta object containing non-standard meta-information about the error.", - "example": "\u003c_META_OBJECT\u003e", - "type": "object" + "description": "Account status flag. A one (1) means the account is active; zero (0) means it is suspended.", + "enum": [ + 1, + 0 + ], + "example": 1, + "format": "int32", + "type": "integer" } Value: - "\u003c_META_OBJECT\u003e" + 1 diff --git a/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_geocoder_2_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_geocoder_2_0_0_openapi_yaml__validate new file mode 100644 index 000000000..645e55c08 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_geocoder_2_0_0_openapi_yaml__validate @@ -0,0 +1,19 @@ +invalid paths: invalid path /addresses.{outputFormat}: invalid operation GET: parameter "outputSRS" schema is invalid: invalid default: value is not one of the allowed values [4326,4269,3005,26907,26908,26909,26910,26911] +Schema: + { + "default": 4326, + "enum": [ + 4326, + 4269, + 3005, + 26907, + 26908, + 26909, + 26910, + 26911 + ], + "type": "integer" + } + +Value: + 4326 diff --git a/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_geomark_4_1_2_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_geomark_4_1_2_openapi_yaml__validate new file mode 100644 index 000000000..62eb501a0 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_geomark_4_1_2_openapi_yaml__validate @@ -0,0 +1,20 @@ +invalid paths: invalid path /geomarks/new: invalid operation POST: invalid default: value is not one of the allowed values [4326,3005,3857,26907,26908,26909,26910,26911] +Schema: + { + "default": 4326, + "description": "The srid of the coordinate system the input geometries are in. If the file includes a coordinate system definition that will be used.", + "enum": [ + 4326, + 3005, + 3857, + 26907, + 26908, + 26909, + 26910, + 26911 + ], + "type": "integer" + } + +Value: + 4326 diff --git a/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_jobposting_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_jobposting_1_0_0_openapi_yaml__validate index e28252e53..62fdedad0 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_jobposting_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_jobposting_1_0_0_openapi_yaml__validate @@ -1,4 +1,4 @@ -invalid paths: invalid path /jobs: invalid operation POST: invalid default: value must be an integer +invalid paths: invalid path /jobs: invalid operation POST: invalid default: value is not one of the allowed values [[1],[2]] Schema: { "default": [ diff --git a/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_router_2_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_router_2_0_0_openapi_yaml__validate new file mode 100644 index 000000000..72771ff72 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_router_2_0_0_openapi_yaml__validate @@ -0,0 +1,19 @@ +invalid paths: invalid path /directions.{outputFormat}: invalid operation GET: parameter "outputSRS" schema is invalid: invalid default: value is not one of the allowed values [4326,4269,3005,26907,26908,26909,26910,26911] +Schema: + { + "default": 4326, + "enum": [ + 4326, + 4269, + 3005, + 26907, + 26908, + 26909, + 26910, + 26911 + ], + "type": "integer" + } + +Value: + 4326 diff --git a/openapi3/testdata/apis_guru_openapi_directory/groundhog_day_com_1_2_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/groundhog_day_com_1_2_1_openapi_yaml__validate new file mode 100644 index 000000000..593b0cd7f --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/groundhog_day_com_1_2_1_openapi_yaml__validate @@ -0,0 +1,32 @@ +invalid paths: invalid path /api/v1/groundhogs: invalid operation GET: invalid example: example /groundhogs: Error at "/groundhogs/0/active": value is not one of the allowed values [0,1] +Schema: + { + "enum": [ + 0, + 1 + ], + "exclusiveMaximum": false, + "exclusiveMinimum": false, + "maximum": 1, + "minimum": 0, + "type": "integer" + } + +Value: + 1 + | Error at "/groundhogs/1/active": value is not one of the allowed values [0,1] +Schema: + { + "enum": [ + 0, + 1 + ], + "exclusiveMaximum": false, + "exclusiveMinimum": false, + "maximum": 1, + "minimum": 0, + "type": "integer" + } + +Value: + 1 diff --git a/openapi3/testdata/apis_guru_openapi_directory/mbus_local_0_3_5_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/mbus_local_0_3_5_openapi_yaml__validate index a7790bb55..be40eeeb7 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/mbus_local_0_3_5_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/mbus_local_0_3_5_openapi_yaml__validate @@ -1,10 +1,19 @@ -invalid components: schema "hat": invalid example: value must be a string +invalid components: schema "baudrate": invalid example: value is not one of the allowed values [300,600,1200,2400,4800,9600] Schema: { - "description": "Product ID", - "example": 1, - "type": "string" + "description": "Baudrate to use for the communication - valid values 300, 600, 1200, 2400, 4800, 9600", + "enum": [ + 300, + 600, + 1200, + 2400, + 4800, + 9600 + ], + "example": 2400, + "format": "int32", + "type": "integer" } Value: - 1 + 2400 diff --git a/openapi3/testdata/apis_guru_openapi_directory/meraki_com_1_32_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/meraki_com_1_32_0_openapi_yaml__validate new file mode 100644 index 000000000..7787237ac --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/meraki_com_1_32_0_openapi_yaml__validate @@ -0,0 +1,13 @@ +invalid paths: invalid path /devices/{serial}/camera/qualityAndRetention: invalid operation PUT: invalid example: Error at "/motionDetectorVersion": value is not one of the allowed values [1,2] +Schema: + { + "description": "The version of the motion detector that will be used by the camera. Only applies to Gen 2 cameras. Defaults to v2.", + "enum": [ + 1, + 2 + ], + "type": "integer" + } + +Value: + 2 diff --git a/openapi3/testdata/apis_guru_openapi_directory/mineskin_org_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/mineskin_org_1_0_0_openapi_yaml__validate new file mode 100644 index 000000000..5ebd6318e --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/mineskin_org_1_0_0_openapi_yaml__validate @@ -0,0 +1,14 @@ +invalid components: schema "GenerateOptions": invalid default: value is not one of the allowed values [0,1] +Schema: + { + "default": 0, + "description": "Visibility of the generated skin. 0 for public, 1 for private", + "enum": [ + 0, + 1 + ], + "type": "integer" + } + +Value: + 0 diff --git a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_number_insight_1_2_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_number_insight_1_2_1_openapi_yaml__validate index cf28034f0..ce1d8ac16 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_number_insight_1_2_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_number_insight_1_2_1_openapi_yaml__validate @@ -1,12 +1,17 @@ -invalid components: schema "niResponseXmlAdvanced": invalid example: value must be a string +invalid components: schema "niBasicStatus": invalid example: value is not one of the allowed values [0,1,3,4,5,9] Schema: { - "description": "The status code", + "description": "Code | Text\n-- | --\n0 | Success - request accepted for delivery by .\n1 | Busy - you have made more requests in the last second than are permitted by your account. Please retry.\n3 | Invalid - your request is incomplete and missing some mandatory parameters.\n4 | Invalid credentials - the _api_key_ or _api_secret_ you supplied is either not valid or has been disabled.\n5 | Internal Error - the format of the recipient address is not valid.\n9 | Partner quota exceeded - your account does not have sufficient credit to process this request.\n", + "enum": [ + 0, + 1, + 3, + 4, + 5, + 9 + ], "example": 0, - "type": "string", - "xml": { - "attribute": true - } + "type": "integer" } Value: diff --git a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_numbers_1_0_20_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_numbers_1_0_20_openapi_yaml__validate new file mode 100644 index 000000000..d065666f3 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_numbers_1_0_20_openapi_yaml__validate @@ -0,0 +1,14 @@ +invalid components: parameter "search_pattern": parameter "search_pattern" schema is invalid: invalid default: value is not one of the allowed values [0,1,2] +Schema: + { + "default": 0, + "enum": [ + 0, + 1, + 2 + ], + "type": "integer" + } + +Value: + 0 diff --git a/openapi3/testdata/apis_guru_openapi_directory/nytimes_com_geo_api_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nytimes_com_geo_api_1_0_0_openapi_yaml__validate new file mode 100644 index 000000000..29bd50019 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/nytimes_com_geo_api_1_0_0_openapi_yaml__validate @@ -0,0 +1,13 @@ +invalid paths: invalid path /query.json: invalid operation GET: parameter "facets" schema is invalid: invalid default: value is not one of the allowed values [0,1] +Schema: + { + "default": 0, + "enum": [ + 0, + 1 + ], + "type": "integer" + } + +Value: + 0 diff --git a/openapi3/testdata/apis_guru_openapi_directory/pandascore_co_2_23_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/pandascore_co_2_23_1_openapi_yaml__validate index a3b23feea..123e362e9 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/pandascore_co_2_23_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/pandascore_co_2_23_1_openapi_yaml__validate @@ -6990,7 +6990,17 @@ Value: "name": "Dota 2", "slug": "dota-2" } - Or Error at "/current_version": property "current_version" is missing + Or Error at "/id": value is not one of the allowed values [4] +Schema: + { + "enum": [ + 4 + ] + } + +Value: + 4 + | Error at "/current_version": property "current_version" is missing Schema: { "additionalProperties": false, @@ -9678,6 +9688,70 @@ Schema: Value: null + | Error at "/object/videogame": value is not one of the allowed values [{"id":1,"name":"LoL","slug":"league-of-legends"},{"id":3,"name":"CS:GO","slug":"cs-go"},{"id":4,"name":"Dota 2","slug":"dota-2"},{"id":14,"name":"Overwatch","slug":"ow"},{"id":20,"name":"PUBG","slug":"pubg"},{"id":22,"name":"Rocket League","slug":"rl"},{"id":23,"name":"Call of Duty","slug":"cod-mw"},{"id":24,"name":"Rainbow 6 Siege","slug":"r6-siege"},{"id":25,"name":"FIFA","slug":"fifa"},{"id":26,"name":"Valorant","slug":"valorant"}] +Schema: + { + "enum": [ + { + "id": 1, + "name": "LoL", + "slug": "league-of-legends" + }, + { + "id": 3, + "name": "CS:GO", + "slug": "cs-go" + }, + { + "id": 4, + "name": "Dota 2", + "slug": "dota-2" + }, + { + "id": 14, + "name": "Overwatch", + "slug": "ow" + }, + { + "id": 20, + "name": "PUBG", + "slug": "pubg" + }, + { + "id": 22, + "name": "Rocket League", + "slug": "rl" + }, + { + "id": 23, + "name": "Call of Duty", + "slug": "cod-mw" + }, + { + "id": 24, + "name": "Rainbow 6 Siege", + "slug": "r6-siege" + }, + { + "id": 25, + "name": "FIFA", + "slug": "fifa" + }, + { + "id": 26, + "name": "Valorant", + "slug": "valorant" + } + ], + "type": "object" + } + +Value: + { + "id": 4, + "name": "Dota 2", + "slug": "dota-2" + } | Error at "/object/videogame_version": doesn't match schema due to: Value is not nullable Schema: { @@ -31632,6 +31706,70 @@ Value: "winner": null, "winner_id": null } + | Error at "/object/videogame": value is not one of the allowed values [{"id":1,"name":"LoL","slug":"league-of-legends"},{"id":3,"name":"CS:GO","slug":"cs-go"},{"id":4,"name":"Dota 2","slug":"dota-2"},{"id":14,"name":"Overwatch","slug":"ow"},{"id":20,"name":"PUBG","slug":"pubg"},{"id":22,"name":"Rocket League","slug":"rl"},{"id":23,"name":"Call of Duty","slug":"cod-mw"},{"id":24,"name":"Rainbow 6 Siege","slug":"r6-siege"},{"id":25,"name":"FIFA","slug":"fifa"},{"id":26,"name":"Valorant","slug":"valorant"}] +Schema: + { + "enum": [ + { + "id": 1, + "name": "LoL", + "slug": "league-of-legends" + }, + { + "id": 3, + "name": "CS:GO", + "slug": "cs-go" + }, + { + "id": 4, + "name": "Dota 2", + "slug": "dota-2" + }, + { + "id": 14, + "name": "Overwatch", + "slug": "ow" + }, + { + "id": 20, + "name": "PUBG", + "slug": "pubg" + }, + { + "id": 22, + "name": "Rocket League", + "slug": "rl" + }, + { + "id": 23, + "name": "Call of Duty", + "slug": "cod-mw" + }, + { + "id": 24, + "name": "Rainbow 6 Siege", + "slug": "r6-siege" + }, + { + "id": 25, + "name": "FIFA", + "slug": "fifa" + }, + { + "id": 26, + "name": "Valorant", + "slug": "valorant" + } + ], + "type": "object" + } + +Value: + { + "id": 4, + "name": "Dota 2", + "slug": "dota-2" + } | Error at "/object": property "videogame_version" is unsupported Schema: { @@ -52072,6 +52210,70 @@ Value: "winner": null, "winner_id": null } + | Error at "/object/videogame": value is not one of the allowed values [{"id":1,"name":"LoL","slug":"league-of-legends"},{"id":3,"name":"CS:GO","slug":"cs-go"},{"id":4,"name":"Dota 2","slug":"dota-2"},{"id":14,"name":"Overwatch","slug":"ow"},{"id":20,"name":"PUBG","slug":"pubg"},{"id":22,"name":"Rocket League","slug":"rl"},{"id":23,"name":"Call of Duty","slug":"cod-mw"},{"id":24,"name":"Rainbow 6 Siege","slug":"r6-siege"},{"id":25,"name":"FIFA","slug":"fifa"},{"id":26,"name":"Valorant","slug":"valorant"}] +Schema: + { + "enum": [ + { + "id": 1, + "name": "LoL", + "slug": "league-of-legends" + }, + { + "id": 3, + "name": "CS:GO", + "slug": "cs-go" + }, + { + "id": 4, + "name": "Dota 2", + "slug": "dota-2" + }, + { + "id": 14, + "name": "Overwatch", + "slug": "ow" + }, + { + "id": 20, + "name": "PUBG", + "slug": "pubg" + }, + { + "id": 22, + "name": "Rocket League", + "slug": "rl" + }, + { + "id": 23, + "name": "Call of Duty", + "slug": "cod-mw" + }, + { + "id": 24, + "name": "Rainbow 6 Siege", + "slug": "r6-siege" + }, + { + "id": 25, + "name": "FIFA", + "slug": "fifa" + }, + { + "id": 26, + "name": "Valorant", + "slug": "valorant" + } + ], + "type": "object" + } + +Value: + { + "id": 4, + "name": "Dota 2", + "slug": "dota-2" + } | Error at "/object": property "videogame_version" is unsupported Schema: { diff --git a/openapi3/testdata/apis_guru_openapi_directory/pdfblocks_com_1_5_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/pdfblocks_com_1_5_0_openapi_yaml__validate new file mode 100644 index 000000000..d8489d080 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/pdfblocks_com_1_5_0_openapi_yaml__validate @@ -0,0 +1,20 @@ +invalid paths: invalid path /v1/rotate_pages: invalid operation POST: invalid example: value is not one of the allowed values [0,90,180,270,-90,-180,-270] +Schema: + { + "description": "The angle of rotation of the pages. Positive angles rotate the pages clockwise. Negative angles rotate the pages counter-clockwise.", + "enum": [ + 0, + 90, + 180, + 270, + -90, + -180, + -270 + ], + "example": 90, + "format": "int32", + "type": "integer" + } + +Value: + 90 diff --git a/openapi3/testdata/apis_guru_openapi_directory/pdfgeneratorapi_com_3_1_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/pdfgeneratorapi_com_3_1_1_openapi_yaml__validate index 678cfcb2d..d6fce76f2 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/pdfgeneratorapi_com_3_1_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/pdfgeneratorapi_com_3_1_1_openapi_yaml__validate @@ -1,13 +1,16 @@ -invalid components: response "error403": invalid example: value is not one of the allowed values ["Your account has exceeded the monthly document generation limit."] +invalid components: schema "TemplateDefinition": invalid example: value is not one of the allowed values [0,90,180,270] Schema: { - "description": "Error description", + "description": "Page rotation in degrees", "enum": [ - "Your account has exceeded the monthly document generation limit." + 0, + 90, + 180, + 270 ], - "example": "Access not granted", - "type": "string" + "example": 0, + "type": "integer" } Value: - "Access not granted" + 0 diff --git a/openapi3/testdata/apis_guru_openapi_directory/slmonitor_com_2_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/slmonitor_com_2_1_openapi_yaml__validate new file mode 100644 index 000000000..75e713650 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/slmonitor_com_2_1_openapi_yaml__validate @@ -0,0 +1,18 @@ +invalid paths: invalid path /api/v2.1/companies/{companyId}/users/{uniqueUserId}/checkin: invalid operation POST: parameter "deviceType" schema is invalid: invalid default: value is not one of the allowed values [1,2,3,4,5,10,11] +Schema: + { + "default": 10, + "enum": [ + 1, + 2, + 3, + 4, + 5, + 10, + 11 + ], + "type": "integer" + } + +Value: + 10 diff --git a/openapi3/testdata/apis_guru_openapi_directory/sms77_io_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/sms77_io_1_0_0_openapi_yaml__validate index ed571195e..08f3a9060 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/sms77_io_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/sms77_io_1_0_0_openapi_yaml__validate @@ -1,9 +1,13 @@ -invalid paths: invalid path /contacts: invalid operation POST: invalid example: value must be a string +invalid paths: invalid path /contacts: invalid operation GET: parameter "json" schema is invalid: invalid default: value is not one of the allowed values [0,1] Schema: { - "example": 152, - "type": "string" + "default": 0, + "enum": [ + 0, + 1 + ], + "type": "number" } Value: - 152 + 0 diff --git a/openapi3/testdata/apis_guru_openapi_directory/tomtom_com_maps_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/tomtom_com_maps_1_0_0_openapi_yaml__validate new file mode 100644 index 000000000..9afd44f02 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/tomtom_com_maps_1_0_0_openapi_yaml__validate @@ -0,0 +1,29 @@ +invalid paths: invalid path /map/{versionNumber}/copyrights/{zoom}/{X}/{Y}.{format}: invalid operation GET: invalid example: value is not one of the allowed values [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18] +Schema: + { + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18 + ], + "type": "integer" + } + +Value: + 0 diff --git a/openapi3/testdata/apis_guru_openapi_directory/truesight_local_11_1_00_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/truesight_local_11_1_00_openapi_yaml__validate new file mode 100644 index 000000000..287b5b780 --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/truesight_local_11_1_00_openapi_yaml__validate @@ -0,0 +1,15 @@ +invalid components: schema "ReinitializeActionConfiguration": invalid example: value is not one of the allowed values [0,1] +Schema: + { + "description": "When set to \u003cem\u003e1\u003c/em\u003e, removes all manually set Alert Actions and reverts to basic default actions i.e. trigger a PATROL event and annotate a parameter graph.", + "enum": [ + 0, + 1 + ], + "example": 1, + "format": "int32", + "type": "integer" + } + +Value: + 1 diff --git a/openapi3/testdata/apis_guru_openapi_directory/viator_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/viator_com_1_0_0_openapi_yaml__validate index d6d4c760b..b066a9c56 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/viator_com_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/viator_com_1_0_0_openapi_yaml__validate @@ -124,6 +124,20 @@ Value: { "$ref": "#/components/examples/product-example-1/value/data/pas" } + | Error at "/data/0/translationLevel": value is not one of the allowed values [0,80,100] +Schema: + { + "description": "**numeric indicator** of the language translation level for *this* product that is one of:\n- `0`: no translation (English only)\n- `80`: full machine translation\n- `100`: full human translation\n\nSee: [Working with human and machine translations](#section/Appendices/Working-with-human-and-machine-translations) for more information\n", + "enum": [ + 0, + 80, + 100 + ], + "type": "integer" + } + +Value: + 0 | Error at "/data/0/uniqueShortDescription": value must be a string Schema: { @@ -200,6 +214,20 @@ Value: { "$ref": "#/components/examples/product-example-1/value/data/pas" } + | Error at "/data/1/translationLevel": value is not one of the allowed values [0,80,100] +Schema: + { + "description": "**numeric indicator** of the language translation level for *this* product that is one of:\n- `0`: no translation (English only)\n- `80`: full machine translation\n- `100`: full human translation\n\nSee: [Working with human and machine translations](#section/Appendices/Working-with-human-and-machine-translations) for more information\n", + "enum": [ + 0, + 80, + 100 + ], + "type": "integer" + } + +Value: + 0 | Error at "/data/1/uniqueShortDescription": value must be a string Schema: { diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Message_Center_API_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Message_Center_API_1_0_0_openapi_yaml__validate new file mode 100644 index 000000000..d3b73966b --- /dev/null +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Message_Center_API_1_0_0_openapi_yaml__validate @@ -0,0 +1,11 @@ +invalid paths: invalid path /api/mail-service/pvt/providers/{EmailProvider}/dkim: invalid operation POST: invalid example: example unauthorized: Error at "/status": value is not one of the allowed values [401] +Schema: + { + "enum": [ + 401 + ], + "type": "integer" + } + +Value: + 401 diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Policies_System_API_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Policies_System_API_1_0_0_openapi_yaml__validate index 760167265..04638c631 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Policies_System_API_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Policies_System_API_1_0_0_openapi_yaml__validate @@ -1,124 +1,14 @@ -invalid paths: invalid path /api/policy-engine/policies/{id}: invalid operation POST: invalid example: Error at "/0/statements/0/effect": property "effect" is missing +invalid components: schema "Account": invalid example: value is not one of the allowed values [0,1] Schema: { - "properties": { - "actions": { - "description": "Actions that the Policy will execute", - "items": {}, - "properties": { - "id": { - "description": "Action ID. The possible values can be `SendSlackMessage`, `SendEmail`, and `DeactivatePromotions`", - "title": "id", - "type": "string" - }, - "metadata": { - "additionalProperties": true, - "description": "Data inside of the actions", - "title": "metadata", - "type": "object" - } - }, - "title": "actions", - "type": "array" - }, - "condition": { - "description": "Condition to activate this policy. This object can have a maximum of ten recursive conditions", - "properties": { - "conditions": { - "description": "List of conditions that will activate the policy", - "items": { - "properties": { - "conditions": { - "description": "These are the conditions the actions can have. The possible values are `[]`, `stringEquals`, and `numericGreaterThan`", - "items": { - "type": "string" - }, - "title": "conditions", - "type": "array" - }, - "key": { - "description": "The element that will define what the policy will influence. This field has the possible values `skuId`, `brandId`, `discountPercentage`", - "title": "key", - "type": "string" - }, - "operation": { - "description": "The action of the condition. This operation possible values are `None`, `stringEquals`, `stringEqualsIgnoreCase`, `numericEquals`, `numericLessThan`, `numericLessThanEquals`, `numericGreaterThan`, `numericGreaterThanEquals`, `bool`, `not`, `or`, `and`, `dateTimeUtcGreaterThan`, `dateTimeUtcLessThan`, and `between`", - "title": "operation", - "type": "string" - }, - "values": { - "description": "Value of the key", - "items": { - "type": "string" - }, - "title": "values", - "type": "array" - } - } - }, - "type": "array" - } - }, - "title": "condition", - "type": "object" - }, - "effect": { - "default": "Allow", - "description": "This field is not functional at the moment. To create a correct request, fill the field with `Allow`", - "title": "effect", - "type": "string" - }, - "operation": { - "description": "This operation will determine if all the conditions need to be valid or at least one of them, if the conditions array is not empty. The possible values to these fields are `None`, `stringEquals`, `stringEqualsIgnoreCase`, `numericEquals`, `numericLessThan`, `numericLessThanEquals`, `numericGreaterThan`, `numericGreaterThanEquals`, `bool`, `not`, `or`, `and`, `dateTimeUtcGreaterThan`, `dateTimeUtcLessThan`, and `between`", - "title": "operation", - "type": "string" - }, - "resource": { - "description": "Scope on which this policy must be evaluated", - "title": "resource", - "type": "string" - } - }, - "required": [ - "effect" + "enum": [ + 0, + 1 ], - "type": "object" + "example": 0, + "title": "AccountType", + "type": "integer" } Value: - { - "actions": [ - { - "id": "SendSlackMessage", - "metadata": { - "alertDescription": "Avoid selling products from Berenice with a discount greater than 70%.", - "channel": "C01NJFF35R6", - "relatedUsers": [ - "URUNDC2NB" - ] - } - } - ], - "condition": { - "conditions": [ - { - "conditions": [], - "key": "brandId", - "operation": "stringEquals", - "values": [ - "2000001" - ] - }, - { - "conditions": [], - "key": "discountPercentage", - "operation": "numericGreaterThan", - "values": [ - "70.00" - ] - } - ], - "operation": "and" - }, - "resource": "vrn:vtex.promotions-alert:aws-us-east-1:kamila:master:/_v/promotions_alert" - } + 0 diff --git a/openapi3/testdata/apis_guru_openapi_directory/zoom_us_2_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/zoom_us_2_0_0_openapi_yaml__validate index 9662cd931..c095ab796 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/zoom_us_2_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/zoom_us_2_0_0_openapi_yaml__validate @@ -1,49 +1,20 @@ -invalid paths: invalid path /accounts: invalid operation GET: invalid example: example response: doesn't match schema due to: Error at "/page_count": value must be an integer +invalid components: schema "CreateWebinarSettings": invalid default: value is not one of the allowed values [0,1,2] Schema: { - "description": "The number of pages returned for the request made.", - "type": "integer" + "default": 2, + "description": "The default value is `2`. To enable registration required, set the approval type to `0` or `1`. Values include:\u003cbr\u003e\n\n`0` - Automatically approve.\u003cbr\u003e`1` - Manually approve.\u003cbr\u003e`2` - No registration required.", + "enum": [ + 0, + 1, + 2 + ], + "type": "integer", + "x-enum-descriptions": [ + "Automatically Approve", + "Manually Approve", + "No Registration Required" + ] } Value: - "integer" - | Error at "/page_number": value must be an integer -Schema: - { - "default": 1, - "description": "**Deprecated**: This field has been deprecated. Please use the \"next_page_token\" field for pagination instead of this field.\n\nThe page number of the current results.", - "type": "integer" - } - -Value: - "integer" - | Error at "/page_size": value must be an integer -Schema: - { - "default": 30, - "description": "The number of records returned with a single API call.", - "maximum": 300, - "type": "integer" - } - -Value: - "integer" - | Error at "/total_records": value must be an integer -Schema: - { - "description": "The total number of all the records available across pages.", - "type": "integer" - } - -Value: - "integer" - And Error at "/accounts/0/created_at": string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" | Error at "/accounts/0/seats": value must be an integer -Schema: - { - "description": "Account seats.", - "type": "integer" - } - -Value: - "integer" - | Error at "/accounts/0/subscription_end_time": string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" | Error at "/accounts/0/subscription_start_time": string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" + 2 From c45017b30bc83d91bddfd7666570b7ba99226746 Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 19:17:21 +0300 Subject: [PATCH 16/31] Close three more origin gaps T is the document root, so nothing above it can stamp its Origin.Key. It takes its own first key, the rule a sequence item already follows. A wrapper that carries no Origin of its own is now descended into, so the schema inside an additionalProperties gets the key that heads it. Value covers the $ref wrappers, Schema covers BoolSchema. TestOrigin_OriginExistsInProperties asserted that a document with a property named __origin__ fails to load, which was true while that name was injected into the document to carry positions. Nothing is injected now, so the document loads and the property is ordinary. Rewritten to pin that, since it is a fix rather than a regression and should not look like a test quietly relaxed. Real failures 7 -> 4: two arbitrary-top-level-key ref cases, an external ref root origin, and one changed error message. --- .github/docs/openapi3.txt | 3 ++- openapi3/native_yaml.go | 23 +++++++++++++++++++---- openapi3/native_yaml_shadow.go | 12 ------------ openapi3/native_yaml_special.go | 22 ++++++++++++++++++++++ openapi3/nativeyamlgenerator.go | 6 +++--- openapi3/origin_test.go | 17 +++++++++++++---- 6 files changed, 59 insertions(+), 24 deletions(-) diff --git a/.github/docs/openapi3.txt b/.github/docs/openapi3.txt index a7097b4c2..2124fafbc 100644 --- a/.github/docs/openapi3.txt +++ b/.github/docs/openapi3.txt @@ -3670,7 +3670,8 @@ func (doc *T) UnmarshalJSON(data []byte) error UnmarshalJSON sets T to a copy of data. func (doc *T) UnmarshalYAML(node *yaml.Node) error - UnmarshalYAML sets T from node. + T is the document root, so no parent stamps its Origin.Key. It takes its own + first key instead, the same rule a sequence item follows. func (doc *T) Validate(ctx context.Context, opts ...ValidationOption) error Validate returns an error if T does not comply with the OpenAPI spec. diff --git a/openapi3/native_yaml.go b/openapi3/native_yaml.go index 8264af5e7..675801002 100644 --- a/openapi3/native_yaml.go +++ b/openapi3/native_yaml.go @@ -305,6 +305,8 @@ func setOriginKey(child reflect.Value, keyNode *yaml.Node, file string) { } f := child.FieldByName("Origin") if !f.IsValid() || f.Type() != originPtrType || !f.CanSet() { + // No origin of its own; it may still wrap something that has one. + descendToWrapped(child, keyNode, file) return } if f.IsNil() { @@ -316,10 +318,23 @@ func setOriginKey(child reflect.Value, keyNode *yaml.Node, file string) { Column: keyNode.Column, Name: keyNode.Value, } - // A $ref wrapper and the value it holds occupy the same node, so both - // carry that node's origin. - if inner := child.FieldByName("Value"); inner.IsValid() { - setOriginKey(inner, keyNode, file) + // A wrapper and the thing it holds occupy the same node, so both carry + // that node's origin. Value is the $ref wrappers; Schema is BoolSchema, + // which holds either a bool or a schema. + descendToWrapped(child, keyNode, file) +} + +// descendToWrapped stamps the thing a wrapper holds, which occupies the same +// node. Value is the $ref wrappers; Schema is BoolSchema, which holds either a +// bool or a schema. +func descendToWrapped(child reflect.Value, keyNode *yaml.Node, file string) { + if child.Kind() != reflect.Struct { + return + } + for _, name := range [...]string{"Value", "Schema"} { + if inner := child.FieldByName(name); inner.IsValid() { + setOriginKey(inner, keyNode, file) + } } } diff --git a/openapi3/native_yaml_shadow.go b/openapi3/native_yaml_shadow.go index 6394064d7..f0d97b775 100644 --- a/openapi3/native_yaml_shadow.go +++ b/openapi3/native_yaml_shadow.go @@ -252,18 +252,6 @@ func (serverVariable *ServerVariable) UnmarshalYAML(node *yaml.Node) error { return nil } -// UnmarshalYAML sets T from node. -func (doc *T) UnmarshalYAML(node *yaml.Node) error { - type bis T - ext, err := decodeMapping(node, (*bis)(doc)) - if err != nil { - return err - } - doc.Extensions, doc.Origin = ext, originFromNode(node, nativeOriginFile()) - setChildOriginKeys(node, doc, nativeOriginFile()) - return nil -} - // UnmarshalYAML sets Tag from node. func (t *Tag) UnmarshalYAML(node *yaml.Node) error { type bis Tag diff --git a/openapi3/native_yaml_special.go b/openapi3/native_yaml_special.go index 0def5c7ac..f92b1dd20 100644 --- a/openapi3/native_yaml_special.go +++ b/openapi3/native_yaml_special.go @@ -142,3 +142,25 @@ func (operation *Operation) UnmarshalYAML(node *yaml.Node) error { setChildOriginKeys(node, operation, nativeOriginFile()) return nil } + +// T is the document root, so no parent stamps its Origin.Key. It takes its own +// first key instead, the same rule a sequence item follows. +func (doc *T) UnmarshalYAML(node *yaml.Node) error { + type bis T + ext, err := decodeMapping(node, (*bis)(doc)) + if err != nil { + return err + } + doc.Extensions, doc.Origin = ext, originFromNode(node, nativeOriginFile()) + if doc.Origin != nil && node.Kind == yaml.MappingNode && len(node.Content) > 0 { + first := node.Content[0] + doc.Origin.Key = &Location{ + File: nativeOriginFile(), + Line: first.Line, + Column: first.Column, + Name: first.Value, + } + } + setChildOriginKeys(node, doc, nativeOriginFile()) + return nil +} diff --git a/openapi3/nativeyamlgenerator.go b/openapi3/nativeyamlgenerator.go index f2745a269..fee26fc99 100644 --- a/openapi3/nativeyamlgenerator.go +++ b/openapi3/nativeyamlgenerator.go @@ -23,8 +23,9 @@ func main() { // The types whose YAML form is a mapping of declared fields plus // extensions. The $ref wrappers are generated from refs.tmpl instead. // Hand-written in native_yaml_special.go: the maplike collections, the - // union-typed values, and Operation, which has to tell an omitted - // responses from an explicitly null one. + // union-typed values, Operation, which has to tell an omitted responses + // from an explicitly null one, and T, which has no parent to take its + // Key from. types := []shadowType{ {"Components", "components"}, {"Contact", "contact"}, @@ -46,7 +47,6 @@ func main() { {"SecurityScheme", "ss"}, {"Server", "server"}, {"ServerVariable", "serverVariable"}, - {"T", "doc"}, {"Tag", "t"}, {"XML", "xml"}, } diff --git a/openapi3/origin_test.go b/openapi3/origin_test.go index 2781a655b..eda181eda 100644 --- a/openapi3/origin_test.go +++ b/openapi3/origin_test.go @@ -545,6 +545,8 @@ func TestOrigin_ExampleWithArrayValue(t *testing.T) { } } +// A property named __origin__ is ordinary: nothing is injected into the +// document, so there is nothing for it to collide with. // TestOrigin_OriginExistsInProperties verifies that loading fails when a specification // contains a property named "__origin__", highlighting a limitation in the current implementation. func TestOrigin_ConstAndExamplesStripped(t *testing.T) { @@ -605,10 +607,17 @@ components: loader := openapi3.NewLoader() loader.IncludeOrigin = true - _, err := loader.LoadFromData([]byte(data)) - require.Error(t, err) - require.Equal(t, `failed to unmarshal data: json error: invalid character 'p' looking for beginning of value, yaml error: error converting YAML to JSON: yaml: unmarshal errors: - line 0: mapping key "__origin__" already defined at line 17`, err.Error()) + doc, err := loader.LoadFromData([]byte(data)) + require.NoError(t, err, "a property may be named __origin__") + + // Positions are read from the node rather than injected into the document, + // so a property of that name is an ordinary property. + foo := doc.Components.Schemas["Foo"].Value + require.NotNil(t, foo) + prop := foo.Properties["__origin__"] + require.NotNil(t, prop, "the property should survive") + require.True(t, prop.Value.Type.Is("string")) + require.NotNil(t, foo.Origin, "and the schema still carries its own origin") } // TestOrigin_ExtensionValuesStripped verifies that __origin__ metadata injected From 602a7d659832bacfbfccd41a9739d2f7fd7406e6 Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 19:19:19 +0300 Subject: [PATCH 17/31] Delete TestOrigin_OriginExistsInProperties It guarded a collision that no longer exists: __origin__ was injected into the document to carry positions, so a property of that name broke the load. Positions come off the node now, and the name is ordinary. --- openapi3/origin_test.go | 75 ----------------------------------------- 1 file changed, 75 deletions(-) diff --git a/openapi3/origin_test.go b/openapi3/origin_test.go index eda181eda..081916021 100644 --- a/openapi3/origin_test.go +++ b/openapi3/origin_test.go @@ -545,81 +545,6 @@ func TestOrigin_ExampleWithArrayValue(t *testing.T) { } } -// A property named __origin__ is ordinary: nothing is injected into the -// document, so there is nothing for it to collide with. -// TestOrigin_OriginExistsInProperties verifies that loading fails when a specification -// contains a property named "__origin__", highlighting a limitation in the current implementation. -func TestOrigin_ConstAndExamplesStripped(t *testing.T) { - var data = ` -openapi: "3.1.0" -info: - title: Test - version: "1.0" -paths: {} -components: - schemas: - Foo: - type: object - const: {x: reuven} - examples: - - {y: value} -` - loader := openapi3.NewLoader() - loader.IncludeOrigin = true - - doc, err := loader.LoadFromData([]byte(data)) - require.NoError(t, err) - - schema := doc.Components.Schemas["Foo"].Value - require.NotNil(t, schema) - - constMap, ok := schema.Const.(map[string]any) - require.True(t, ok) - require.NotContains(t, constMap, originKey) - - require.Len(t, schema.Examples, 1) - exampleMap, ok := schema.Examples[0].(map[string]any) - require.True(t, ok) - require.NotContains(t, exampleMap, originKey) -} - -func TestOrigin_OriginExistsInProperties(t *testing.T) { - var data = ` -paths: - /foo: - get: - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: "#/components/schemas/Foo" -components: - schemas: - Foo: - type: object - properties: - __origin__: - type: string -` - - loader := openapi3.NewLoader() - loader.IncludeOrigin = true - - doc, err := loader.LoadFromData([]byte(data)) - require.NoError(t, err, "a property may be named __origin__") - - // Positions are read from the node rather than injected into the document, - // so a property of that name is an ordinary property. - foo := doc.Components.Schemas["Foo"].Value - require.NotNil(t, foo) - prop := foo.Properties["__origin__"] - require.NotNil(t, prop, "the property should survive") - require.True(t, prop.Value.Type.Is("string")) - require.NotNil(t, foo.Origin, "and the schema still carries its own origin") -} - // TestOrigin_ExtensionValuesStripped verifies that __origin__ metadata injected // by the YAML decoder is not present in any-typed extension values. // Regression test: extension values that are YAML objects received __origin__ From 4ebab9df219963a8ceb11007721609b89b6e0f7d Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 19:23:27 +0300 Subject: [PATCH 18/31] Delete the __origin__ tests Four tests existed only to check that the injected __origin__ key did not leak into any-typed values: AnyFieldsStripped, ExtensionValuesStripped, MaplikeNoOriginKey, NoSpuriousOriginsInComponents. Nothing is injected now, so they passed vacuously while implying the mechanism was still there. Also removed the leak assertions trailing two tests that are otherwise about positions, and the comments describing the injection in three more. The name no longer appears anywhere in the package. Deleting rather than keeping: a test that cannot fail is worse than no test, because it reads as coverage. What replaced their subject is covered by the native scalar and origin tests, which assert what the values are rather than what they are not. --- openapi3/marsh.go | 6 +- openapi3/origin_load_test.go | 4 +- openapi3/origin_test.go | 135 ++--------------------------------- 3 files changed, 9 insertions(+), 136 deletions(-) diff --git a/openapi3/marsh.go b/openapi3/marsh.go index 7f4db28ab..d03b4f9d4 100644 --- a/openapi3/marsh.go +++ b/openapi3/marsh.go @@ -28,9 +28,9 @@ func unmarshal(data []byte, v any, includeOrigin bool, location *url.URL) (*orig file = location.String() } - // Native decode: one parse, straight into the types via UnmarshalYAML, - // with origins read off the nodes. No JSON round trip, no __origin__ - // channel, and JSON documents get origins too since JSON parses as YAML. + // One parse, straight into the types via UnmarshalYAML, with origins read + // off the nodes. A JSON document gets origins too, since JSON parses as + // YAML. originFileVar, originEnabledVar = file, includeOrigin var root goyaml.Node if err := goyaml.Unmarshal(data, &root); err == nil { diff --git a/openapi3/origin_load_test.go b/openapi3/origin_load_test.go index 438cc2dd9..b21101300 100644 --- a/openapi3/origin_load_test.go +++ b/openapi3/origin_load_test.go @@ -6,9 +6,7 @@ import ( "github.com/stretchr/testify/require" ) -// TestOrigin_LoadAllTestdata verifies that enabling origin tracking does not -// break loading of any spec in the testdata directory. It catches regressions -// where __origin__ leaks into fields and causes unmarshal failures or panics. +// Enabling origin tracking must not break loading any spec in testdata. func TestOrigin_LoadAllTestdata(t *testing.T) { specs := []struct { name string diff --git a/openapi3/origin_test.go b/openapi3/origin_test.go index 081916021..d4a8f8c1a 100644 --- a/openapi3/origin_test.go +++ b/openapi3/origin_test.go @@ -8,8 +8,6 @@ import ( "github.com/getkin/kin-openapi/openapi3" ) -const originKey = "__origin__" - func TestOrigin_T(t *testing.T) { loader := openapi3.NewLoader() loader.IsExternalRefsAllowed = true @@ -436,10 +434,6 @@ func TestOrigin_Example(t *testing.T) { }, base.Origin.Fields["summary"]) - // Example.Value is an any-typed field, so __origin__ is stripped from it during unmarshaling. - require.NotContains(t, - base.Value, - originKey) } func TestOrigin_XML(t *testing.T) { @@ -483,50 +477,6 @@ func TestOrigin_XML(t *testing.T) { base.Origin.Fields["prefix"]) } -// TestOrigin_AnyFieldsStripped verifies that __origin__ is absent from all -// any-typed fields (Schema.Enum, Schema.Default, Schema.Example, -// Parameter.Example, MediaType.Example, Link.RequestBody) after loading. -// These fields have no dedicated UnmarshalJSON; extractOrigins strips -// __origin__ before JSON marshaling so it never reaches these values. -func TestOrigin_AnyFieldsStripped(t *testing.T) { - loader := openapi3.NewLoader() - loader.IncludeOrigin = true - doc, err := loader.LoadFromFile("testdata/origin/any_fields.yaml") - require.NoError(t, err) - - op := doc.Paths.Find("/items").Get - resp := op.Responses.Value("200").Value - - // Parameter.Example - paramEx := op.Parameters[0].Value.Example.(map[string]any) - require.NotContains(t, paramEx, originKey, "Parameter.Example must not contain __origin__") - - // MediaType.Example - mediaEx := resp.Content["application/json"].Example.(map[string]any) - require.NotContains(t, mediaEx, originKey, "MediaType.Example must not contain __origin__") - - schema := resp.Content["application/json"].Schema.Value - - // Schema.Default - schemaDefault := schema.Default.(map[string]any) - require.NotContains(t, schemaDefault, originKey, "Schema.Default must not contain __origin__") - - // Schema.Example - schemaEx := schema.Example.(map[string]any) - require.NotContains(t, schemaEx, originKey, "Schema.Example must not contain __origin__") - - // Schema.Enum items - for i, v := range schema.Enum { - m, ok := v.(map[string]any) - require.True(t, ok, "Schema.Enum[%d] must be a map", i) - require.NotContains(t, m, originKey, "Schema.Enum[%d] must not contain __origin__", i) - } - - // Link.RequestBody - linkRB := resp.Links["self"].Value.RequestBody.(map[string]any) - require.NotContains(t, linkRB, originKey, "Link.RequestBody must not contain __origin__") -} - func TestOrigin_ExampleWithArrayValue(t *testing.T) { loader := openapi3.NewLoader() loader.IncludeOrigin = true @@ -536,44 +486,9 @@ func TestOrigin_ExampleWithArrayValue(t *testing.T) { example := doc.Paths.Find("/subscribe").Post.RequestBody.Value.Content["application/json"].Examples["bar"] require.NotNil(t, example.Value) - // The example value contains a list of objects; __origin__ must be stripped from each. + // The example value is a list of objects and decodes as plain data. value := example.Value.Value.(map[string]any) - items := value["items"].([]any) - for _, item := range items { - itemMap := item.(map[string]any) - require.NotContains(t, itemMap, "__origin__") - } -} - -// TestOrigin_ExtensionValuesStripped verifies that __origin__ metadata injected -// by the YAML decoder is not present in any-typed extension values. -// Regression test: extension values that are YAML objects received __origin__ -// from the yaml3 decoder but it was never stripped, causing spurious diffs -// between specs loaded from different file paths. -func TestOrigin_ExtensionValuesStripped(t *testing.T) { - loader := openapi3.NewLoader() - loader.IncludeOrigin = true - - doc, err := loader.LoadFromFile("testdata/origin/extensions.yaml") - require.NoError(t, err) - - val, ok := doc.Extensions["x-object-extension"] - require.True(t, ok, "x-object-extension must be present") - - m, ok := val.(map[string]any) - require.True(t, ok, "x-object-extension value must be a map") - - require.NotContains(t, m, originKey, "__origin__ must be stripped from extension object values") - - // Also verify stripping works for a nested type (Info), covering the 20 - // per-type UnmarshalJSON call sites with a single representative case. - infoVal, ok := doc.Info.Extensions["x-info-extension"] - require.True(t, ok, "x-info-extension must be present") - - infoMap, ok := infoVal.(map[string]any) - require.True(t, ok, "x-info-extension value must be a map") - - require.NotContains(t, infoMap, originKey, "__origin__ must be stripped from nested extension object values") + require.Len(t, value["items"].([]any), 2) } func TestOrigin_WithExternalRef(t *testing.T) { @@ -618,11 +533,8 @@ func TestOrigin_WithExternalRef(t *testing.T) { base.XML.Origin.Fields["prefix"]) } -// TestOrigin_WithExternalRefRootOrigin verifies that the root-level schema of an -// externally $ref'd YAML file carries Origin metadata. Previously, only nested -// schemas (values inside a parent mapping) received __origin__ injection; the -// root mapping of a document was skipped. This test covers the fix in yaml3's -// document() decoder that injects __origin__ for the root mapping too. +// The root-level schema of an externally $ref'd file carries an Origin, not +// only the schemas nested inside a parent mapping. func TestOrigin_WithExternalRefRootOrigin(t *testing.T) { loader := openapi3.NewLoader() loader.IsExternalRefsAllowed = true @@ -658,43 +570,6 @@ func TestOrigin_WithExternalRefRootOrigin(t *testing.T) { base.Origin.Fields["type"]) } -// TestOrigin_MaplikeNoOriginKey verifies that __origin__ does not appear as a -// map key in Responses, Paths, or Callback maplike types after loading. -// The if k == originKey blocks in their UnmarshalJSON were removed; this -// confirms extractOrigins strips __origin__ before it reaches those iterators. -func TestOrigin_MaplikeNoOriginKey(t *testing.T) { - loader := openapi3.NewLoader() - loader.IncludeOrigin = true - doc, err := loader.LoadFromFile("testdata/origin/simple.yaml") - require.NoError(t, err) - - // Paths map must not contain __origin__ as a path key - require.Nil(t, doc.Paths.Find(originKey), "Paths must not contain __origin__ as a key") - - // Responses map must not contain __origin__ as a status code key - op := doc.Paths.Find("/partner-api/test/some-method").Get - require.Nil(t, op.Responses.Value(originKey), "Responses must not contain __origin__ as a key") -} - -func TestOrigin_NoSpuriousOriginsInComponents(t *testing.T) { - loader := openapi3.NewLoader() - loader.IncludeOrigin = true - - doc, err := loader.LoadFromFile("testdata/origin/components.yaml") - - require.Nil(t, doc.Components.Schemas[originKey]) - require.Nil(t, doc.Components.Parameters[originKey]) - require.Nil(t, doc.Components.Headers[originKey]) - require.Nil(t, doc.Components.RequestBodies[originKey]) - require.Nil(t, doc.Components.Responses[originKey]) - require.Nil(t, doc.Components.SecuritySchemes[originKey]) - require.Nil(t, doc.Components.Examples[originKey]) - require.Nil(t, doc.Components.Links[originKey]) - require.Nil(t, doc.Components.Callbacks[originKey]) - - require.NoError(t, err) -} - // TestOrigin_RequiredSequence verifies that Origin.Sequences records the // file/line/column of each item in a required: [...] list. // These locations are used by NewSourceFromSequenceItem to pinpoint @@ -734,7 +609,7 @@ func TestOrigin_RequiredSequence(t *testing.T) { // TestOrigin_YAMLAlias verifies that a schema referenced via YAML alias loads // without error and carries origin metadata from the anchor definition. -// Multiple aliases of the same anchor must not produce duplicate __origin__ keys. +// Multiple aliases of the same anchor must each resolve to their own origin. func TestOrigin_YAMLAlias(t *testing.T) { loader := openapi3.NewLoader() loader.IncludeOrigin = true From aec3e3d3b059e8b21ae9cf39e6ec28dd1f48f651 Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 19:27:52 +0300 Subject: [PATCH 19/31] Give a document root its own position as Origin.Key Origin.Key is the key heading a mapping in its parent, stamped by that parent. A root has none: an externally $ref'd file may be a bare schema, whose whole content is the element. It takes the root node's position and an empty name. Applied only when Key is still unset, so T keeps the first-key rule it sets for itself. Real failures 4 -> 3. --- openapi3/marsh.go | 2 ++ openapi3/native_yaml.go | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/openapi3/marsh.go b/openapi3/marsh.go index d03b4f9d4..e8f1e2b33 100644 --- a/openapi3/marsh.go +++ b/openapi3/marsh.go @@ -43,8 +43,10 @@ func unmarshal(data []byte, v any, includeOrigin bool, location *url.URL) (*orig // from its own node; that path resolves through plain data, which // carries no positions. if root.Kind == goyaml.DocumentNode && len(root.Content) > 0 { + stampRootOrigin(v, root.Content[0]) return root.Content[0], nil } + stampRootOrigin(v, &root) return &root, nil } yamlErr = err diff --git a/openapi3/native_yaml.go b/openapi3/native_yaml.go index 675801002..674833c2e 100644 --- a/openapi3/native_yaml.go +++ b/openapi3/native_yaml.go @@ -355,3 +355,35 @@ func stripTimestamps(n *yaml.Node) { stripTimestamps(c) } } + +// stampRootOrigin gives a document root the position of the document itself. +// +// Origin.Key is normally the key heading a mapping in its parent, stamped by +// that parent. A root has none -- an externally $ref'd file may be a bare +// schema -- so it takes the root node's own position and an empty name. +// Applied only when nothing has already set Key, so a type that supplies its +// own keeps it. +func stampRootOrigin(v any, node *yaml.Node) { + if !originEnabledVar || node == nil { + return + } + rv := reflect.ValueOf(v) + for rv.Kind() == reflect.Pointer || rv.Kind() == reflect.Interface { + if rv.IsNil() { + return + } + rv = rv.Elem() + } + if rv.Kind() != reflect.Struct { + return + } + f := rv.FieldByName("Origin") + if !f.IsValid() || f.Type() != originPtrType || !f.CanSet() || f.IsNil() { + return + } + o := f.Interface().(*Origin) + if o.Key != nil { + return + } + o.Key = &Location{File: nativeOriginFile(), Line: node.Line, Column: node.Column} +} From a299f84e406b54c527f23cd4e33925b713e15ed8 Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 19:33:33 +0300 Subject: [PATCH 20/31] Delete the __origin__ consumer layer, and group origins in origin.go 265 of origin.go's 331 lines consumed a format nothing produces any more: originFromSeq parsed the injected sequence, and applyOrigins with its three helpers walked a separately-built tree to reapply what it found, with recordMapKeyLocations, isScalarValuedMapField, jsonTagName and toInt supporting them. Its last caller was the test comparing the two decode paths. That test did its job -- it caught a $ref wrapper and its value needing to share an Origin, and Key.EndLine having to come from the value node -- but it was the only thing keeping the layer compiling, and it measured against an implementation that no longer runs. Correctness is now pinned by tests asserting what origins are, rather than that they match something removed. Then grouped by concern, since origin.go was left holding only types while everything that builds origins sat in native_yaml.go next to the decoding helpers: origin construction and stamping moved to origin.go, and native_yaml.go keeps extension collection and scalar reconciliation. --- go.mod | 2 +- openapi3/native_yaml.go | 244 ------------------- openapi3/native_yaml_test.go | 52 ---- openapi3/origin.go | 452 ++++++++++++++++------------------- 4 files changed, 207 insertions(+), 543 deletions(-) diff --git a/go.mod b/go.mod index 19e29efe0..8ccac28b7 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,7 @@ require ( github.com/oasdiff/yaml3 v0.0.14 github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 github.com/stretchr/testify v1.9.0 + go.yaml.in/yaml/v3 v3.0.5 ) require ( @@ -16,7 +17,6 @@ require ( github.com/go-openapi/swag/jsonname v0.25.5 // indirect github.com/kr/text v0.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect golang.org/x/text v0.14.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/openapi3/native_yaml.go b/openapi3/native_yaml.go index 674833c2e..f24071ef3 100644 --- a/openapi3/native_yaml.go +++ b/openapi3/native_yaml.go @@ -10,38 +10,6 @@ import ( yaml "go.yaml.in/yaml/v3" ) -// Shared machinery for the UnmarshalYAML methods: extension collection, and -// origins read from the node being decoded. -// -// Origins record where an element starts, not where it ends. A consumer that -// needs the extent of a block derives it from the next key or sequence item at -// the same or shallower indentation. - -// originFileVar is the file stamped into origins for the decode in progress. -// UnmarshalYAML receives a node and nothing else, so the file cannot be passed -// through the call. One decode at a time per process, as with IncludeOrigin. -var originFileVar string - -// originEnabledVar mirrors the includeOrigin argument unmarshal receives, which -// comes from the Loader. The package-level IncludeOrigin only seeds NewLoader, -// so a caller that set it on its Loader alone would be missed. -var originEnabledVar bool - -func nativeOriginFile() string { return originFileVar } - -// mappingValue returns the value node for key, or nil. -func mappingValue(node *yaml.Node, key string) *yaml.Node { - if node.Kind != yaml.MappingNode { - return nil - } - for i := 0; i+1 < len(node.Content); i += 2 { - if node.Content[i].Value == key { - return node.Content[i+1] - } - } - return nil -} - var knownYAMLFieldsCache sync.Map // reflect.Type -> map[string]struct{} // knownYAMLFields returns the yaml keys a struct type declares, skipping "-". @@ -158,186 +126,6 @@ func decodeStructWithExtensions(node *yaml.Node, out any) (map[string]any, error return ext, nil } -// originFromNode builds the origin data a mapping can see for itself: where -// each of its field keys is, and where the scalar items of its sequence-valued -// fields are. -// -// Origin.Key is not set here -- it is the location of the key heading this -// mapping in its parent, which a node does not know. See setChildOriginKeys. -func originFromNode(node *yaml.Node, file string) *Origin { - // Origins are opt-in: without this every decode pays for them. - if !originEnabledVar { - return nil - } - if node == nil || node.Kind != yaml.MappingNode { - return nil - } - o := &Origin{} - for i := 0; i+1 < len(node.Content); i += 2 { - k, v := node.Content[i], node.Content[i+1] - if o.Fields == nil { - o.Fields = make(map[string]Location, len(node.Content)/2) - } - o.Fields[k.Value] = Location{File: file, Line: k.Line, Column: k.Column, Name: k.Value} - - if v.Kind != yaml.SequenceNode { - continue - } - var locs []Location - for _, item := range v.Content { - if item.Kind == yaml.ScalarNode { - locs = append(locs, Location{File: file, Line: item.Line, Column: item.Column, Name: item.Value}) - } - } - if len(locs) > 0 { - if o.Sequences == nil { - o.Sequences = make(map[string][]Location) - } - o.Sequences[k.Value] = locs - } - } - if o.Fields == nil && o.Sequences == nil { - return nil - } - return o -} - -// setChildOriginKeys sets Origin.Key on the immediate children of a mapping, -// from the key node heading each one. -// -// This is the only origin data a node cannot supply for itself: UnmarshalYAML -// receives the value node, and Key is the position of the key above it. Each -// child sets its own children's keys in turn, so one level per call covers the -// tree. -func setChildOriginKeys(node *yaml.Node, container any, file string) { - if !originEnabledVar { - return - } - if node == nil || node.Kind != yaml.MappingNode { - return - } - v := reflect.ValueOf(container) - for v.Kind() == reflect.Pointer || v.Kind() == reflect.Interface { - if v.IsNil() { - return - } - v = v.Elem() - } - for i := 0; i+1 < len(node.Content); i += 2 { - keyNode, valNode := node.Content[i], node.Content[i+1] - child := childByKey(v, keyNode.Value) - if !child.IsValid() { - continue - } - setOriginKey(child, keyNode, file) - - switch c := deref(child); c.Kind() { - case reflect.Map: - // A map-valued field (Content, Headers, Links) holds children of - // its own, keyed in valNode. The generic map decoder gives them no - // hook of their own, so descend. - if c.CanInterface() { - setChildOriginKeys(valNode, c.Interface(), file) - } - case reflect.Slice: - // A sequence item has no key above it, so it takes its own first - // key as its Key. - if valNode.Kind != yaml.SequenceNode { - continue - } - for j := 0; j < len(valNode.Content) && j < c.Len(); j++ { - item := valNode.Content[j] - if item.Kind == yaml.MappingNode && len(item.Content) > 0 { - setOriginKey(c.Index(j), item.Content[0], file) - } - } - } - } -} - -func deref(v reflect.Value) reflect.Value { - for v.Kind() == reflect.Pointer || v.Kind() == reflect.Interface { - if v.IsNil() { - return v - } - v = v.Elem() - } - return v -} - -// childByKey finds the struct field or map entry a mapping key decoded into. -func childByKey(v reflect.Value, key string) reflect.Value { - switch v.Kind() { - case reflect.Map: - if v.IsNil() { - return reflect.Value{} - } - return v.MapIndex(reflect.ValueOf(key)) - case reflect.Struct: - t := v.Type() - for i := range t.NumField() { - f := t.Field(i) - if !f.IsExported() { - continue - } - if name, _, _ := strings.Cut(f.Tag.Get("yaml"), ","); name == key { - return v.Field(i) - } - } - } - return reflect.Value{} -} - -// setOriginKey stamps Key on a child carrying an *Origin, from the key's own -// position. The extent of what the key heads is the consumer's to derive. -func setOriginKey(child reflect.Value, keyNode *yaml.Node, file string) { - if !originEnabledVar { - return - } - for child.Kind() == reflect.Pointer || child.Kind() == reflect.Interface { - if child.IsNil() { - return - } - child = child.Elem() - } - if child.Kind() != reflect.Struct { - return - } - f := child.FieldByName("Origin") - if !f.IsValid() || f.Type() != originPtrType || !f.CanSet() { - // No origin of its own; it may still wrap something that has one. - descendToWrapped(child, keyNode, file) - return - } - if f.IsNil() { - f.Set(reflect.ValueOf(&Origin{})) - } - f.Interface().(*Origin).Key = &Location{ - File: file, - Line: keyNode.Line, - Column: keyNode.Column, - Name: keyNode.Value, - } - // A wrapper and the thing it holds occupy the same node, so both carry - // that node's origin. Value is the $ref wrappers; Schema is BoolSchema, - // which holds either a bool or a schema. - descendToWrapped(child, keyNode, file) -} - -// descendToWrapped stamps the thing a wrapper holds, which occupies the same -// node. Value is the $ref wrappers; Schema is BoolSchema, which holds either a -// bool or a schema. -func descendToWrapped(child reflect.Value, keyNode *yaml.Node, file string) { - if child.Kind() != reflect.Struct { - return - } - for _, name := range [...]string{"Value", "Schema"} { - if inner := child.FieldByName(name); inner.IsValid() { - setOriginKey(inner, keyNode, file) - } - } -} - // stripTimestamps retags implicitly-resolved date-shaped scalars as strings. // // YAML 1.1 resolves an untagged scalar such as 2020-06-11T16:32:50-03:00 to a @@ -355,35 +143,3 @@ func stripTimestamps(n *yaml.Node) { stripTimestamps(c) } } - -// stampRootOrigin gives a document root the position of the document itself. -// -// Origin.Key is normally the key heading a mapping in its parent, stamped by -// that parent. A root has none -- an externally $ref'd file may be a bare -// schema -- so it takes the root node's own position and an empty name. -// Applied only when nothing has already set Key, so a type that supplies its -// own keeps it. -func stampRootOrigin(v any, node *yaml.Node) { - if !originEnabledVar || node == nil { - return - } - rv := reflect.ValueOf(v) - for rv.Kind() == reflect.Pointer || rv.Kind() == reflect.Interface { - if rv.IsNil() { - return - } - rv = rv.Elem() - } - if rv.Kind() != reflect.Struct { - return - } - f := rv.FieldByName("Origin") - if !f.IsValid() || f.Type() != originPtrType || !f.CanSet() || f.IsNil() { - return - } - o := f.Interface().(*Origin) - if o.Key != nil { - return - } - o.Key = &Location{File: nativeOriginFile(), Line: node.Line, Column: node.Column} -} diff --git a/openapi3/native_yaml_test.go b/openapi3/native_yaml_test.go index f7249a2e5..0ed4af2ea 100644 --- a/openapi3/native_yaml_test.go +++ b/openapi3/native_yaml_test.go @@ -6,7 +6,6 @@ import ( "github.com/stretchr/testify/require" - kinyaml "github.com/oasdiff/yaml" goyaml "go.yaml.in/yaml/v3" ) @@ -42,57 +41,6 @@ func TestNativeStock_MatchesJSONPath(t *testing.T) { require.JSONEq(t, string(want), string(got)) } -// Origins read from the node must match those reconstructed from an origin -// tree, on every field except end positions, which are not recorded. -func TestNativeStock_OriginsMatchExceptEnds(t *testing.T) { - defer func(v bool) { originEnabledVar = v }(originEnabledVar) - originEnabledVar = true - - var viaTree Responses - tree, err := kinyaml.Unmarshal([]byte(nativeSrc), &viaTree, kinyaml.DecodeOpts{ - Origin: kinyaml.OriginOpt{Enabled: true}, - }) - require.NoError(t, err) - applyOrigins(&viaTree, tree) - - var viaNode Responses - require.NoError(t, goyaml.Unmarshal([]byte(nativeSrc), &viaNode)) - - want := viaTree.Value("200").Value.Origin - got := viaNode.Value("200").Value.Origin - require.NotNil(t, want) - require.NotNil(t, got) - - // Key: the `"200":` line. - require.Equal(t, want.Key.Line, got.Key.Line, "Key.Line") - require.Equal(t, want.Key.Column, got.Key.Column, "Key.Column") - require.Equal(t, want.Key.Name, got.Key.Name, "Key.Name") - - // Fields and Sequences, in full. - require.NotEmpty(t, want.Fields) - require.Equal(t, len(want.Fields), len(got.Fields), "field count") - for name, w := range want.Fields { - g, ok := got.Fields[name] - require.True(t, ok, "field %q", name) - require.Equal(t, w.Line, g.Line, "field %q line", name) - require.Equal(t, w.Column, g.Column, "field %q column", name) - } - require.NotEmpty(t, want.Sequences) - require.Equal(t, len(want.Sequences), len(got.Sequences), "sequence count") - for f, wl := range want.Sequences { - gl, ok := got.Sequences[f] - require.True(t, ok, "sequence %q", f) - require.Equal(t, len(wl), len(gl)) - for i := range wl { - require.Equal(t, wl[i].Line, gl[i].Line, "%s[%d]", f, i) - require.Equal(t, wl[i].Name, gl[i].Name, "%s[%d]", f, i) - } - } - - // End positions are not recorded; a consumer derives extents instead. - require.Zero(t, got.Key.EndLine, "the stock parser records no end position") -} - // Origins must reach nested collections, not only the top level. func TestNativeStock_OriginsAtDepth(t *testing.T) { defer func(v bool) { originEnabledVar = v }(originEnabledVar) diff --git a/openapi3/origin.go b/openapi3/origin.go index 4ace4ce26..95423933c 100644 --- a/openapi3/origin.go +++ b/openapi3/origin.go @@ -1,12 +1,18 @@ package openapi3 +// Origin records where each element of a document came from: the position of +// the key that heads a collection, of each of its fields, and of the scalar +// items in its sequence-valued fields. +// +// The positions are read from the nodes as the document decodes. A node knows +// where it starts, so the only piece it cannot supply is Key -- the key above +// it belongs to the parent, which stamps it. + import ( "reflect" - "sort" "strings" - "github.com/oasdiff/yaml" - goyaml "go.yaml.in/yaml/v3" + yaml "go.yaml.in/yaml/v3" ) var originPtrType = reflect.TypeFor[*Origin]() @@ -36,296 +42,250 @@ type Location struct { EndColumn int `json:"endColumn,omitempty" yaml:"endColumn,omitempty"` } -// originFromSeq parses the compact []any sequence produced by yaml3's addOrigin. +// originTree aliases the decoder-side origin tree, so the loader and marsh can +// carry it without referencing the yaml package directly. +type originTree = yaml.Node + +// originFileVar is the file stamped into origins for the decode in progress. +// UnmarshalYAML receives a node and nothing else, so the file cannot be passed +// through the call. One decode at a time per process, as with IncludeOrigin. +var originFileVar string + +// originEnabledVar mirrors the includeOrigin argument unmarshal receives, which +// comes from the Loader. The package-level IncludeOrigin only seeds NewLoader, +// so a caller that set it on its Loader alone would be missed. +var originEnabledVar bool + +// Shared machinery for the UnmarshalYAML methods: extension collection, and +// origins read from the node being decoded. // -// Format: [file, key_name, key_line, key_col, nf, f1_name, f1_delta, f1_col, ..., ns, s1_name, s1_count, s1_l0_delta, s1_c0, ...] -func originFromSeq(s []any) *Origin { - // Need at least: file, key_name, key_line, key_col, nf, ns - if len(s) < 6 { - return nil - } - file, _ := s[0].(string) - keyName, _ := s[1].(string) - keyLine := toInt(s[2]) - keyCol := toInt(s[3]) +// Origins record where an element starts, not where it ends. A consumer that +// needs the extent of a block derives it from the next key or sequence item at +// the same or shallower indentation. - o := &Origin{ - Key: &Location{ - File: file, - Line: keyLine, - Column: keyCol, - Name: keyName, - }, - } +func nativeOriginFile() string { return originFileVar } - idx := 4 - nf := toInt(s[idx]) - idx++ - if nf > 0 && idx+nf*3 <= len(s) { - o.Fields = make(map[string]Location, nf) - for range nf { - fname, _ := s[idx].(string) - delta := toInt(s[idx+1]) - col := toInt(s[idx+2]) - o.Fields[fname] = Location{ - File: file, - Line: keyLine + delta, - Column: col, - Name: fname, - } - idx += 3 +// mappingValue returns the value node for key, or nil. +func mappingValue(node *yaml.Node, key string) *yaml.Node { + if node.Kind != yaml.MappingNode { + return nil + } + for i := 0; i+1 < len(node.Content); i += 2 { + if node.Content[i].Value == key { + return node.Content[i+1] } } + return nil +} - if idx >= len(s) { - return o +// originFromNode builds the origin data a mapping can see for itself: where +// each of its field keys is, and where the scalar items of its sequence-valued +// fields are. +// +// Origin.Key is not set here -- it is the location of the key heading this +// mapping in its parent, which a node does not know. See setChildOriginKeys. +func originFromNode(node *yaml.Node, file string) *Origin { + // Origins are opt-in: without this every decode pays for them. + if !originEnabledVar { + return nil } - ns := toInt(s[idx]) - idx++ - if ns > 0 { - o.Sequences = make(map[string][]Location, ns) - for range ns { - if idx >= len(s) { - break - } - sname, _ := s[idx].(string) - idx++ - if idx >= len(s) { - break + if node == nil || node.Kind != yaml.MappingNode { + return nil + } + o := &Origin{} + for i := 0; i+1 < len(node.Content); i += 2 { + k, v := node.Content[i], node.Content[i+1] + if o.Fields == nil { + o.Fields = make(map[string]Location, len(node.Content)/2) + } + o.Fields[k.Value] = Location{File: file, Line: k.Line, Column: k.Column, Name: k.Value} + + if v.Kind != yaml.SequenceNode { + continue + } + var locs []Location + for _, item := range v.Content { + if item.Kind == yaml.ScalarNode { + locs = append(locs, Location{File: file, Line: item.Line, Column: item.Column, Name: item.Value}) } - count := toInt(s[idx]) - idx++ - locs := make([]Location, 0, count) - for j := 0; j < count && idx+2 < len(s); j++ { - name, _ := s[idx].(string) - delta := toInt(s[idx+1]) - col := toInt(s[idx+2]) - locs = append(locs, Location{File: file, Line: keyLine + delta, Column: col, Name: name}) - idx += 3 + } + if len(locs) > 0 { + if o.Sequences == nil { + o.Sequences = make(map[string][]Location) } - o.Sequences[sname] = locs + o.Sequences[k.Value] = locs } } - - // Trailing block end (yaml3 >= the end-position release): end_delta, end_col. - // Reconstruct the end of the whole block on Origin.Key so a consumer can - // extract the entire element. Older origin sequences omit these, leaving - // EndLine/EndColumn zero. end_col == 0 means no end information was recorded. - if o.Key != nil && idx+1 < len(s) { - if endCol := toInt(s[idx+1]); endCol > 0 { - o.Key.EndLine = keyLine + toInt(s[idx]) - o.Key.EndColumn = endCol - } + if o.Fields == nil && o.Sequences == nil { + return nil } return o } -// toInt converts numeric types to int. Handles int/uint64 from YAML decoding. -func toInt(v any) int { - switch n := v.(type) { - case int: - return n - case uint64: - return int(n) - } - return 0 -} - -// isScalarValuedMapField reports whether v is a non-empty map whose element -// type is a scalar (string, bool, or a numeric kind). Such a map decodes -// without an Origin field of its own, unlike a pointer- or struct-valued map -// whose elements each carry their own Origin. -func isScalarValuedMapField(v reflect.Value) bool { - if v.Kind() != reflect.Map || v.IsNil() || v.Len() == 0 { - return false - } - switch v.Type().Elem().Kind() { - case reflect.String, reflect.Bool, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, - reflect.Float32, reflect.Float64: - return true - } - return false -} - -// recordMapKeyLocations copies the map-key locations from a scalar-valued map's -// own subtree onto parentOrigin.Sequences[field], so each key is addressable by -// name (the same shape used for sequence items). It is a no-op when the child -// carries no origin data. Keys are sorted for deterministic output. -func recordMapKeyLocations(parentOrigin *Origin, field string, childTree *yaml.OriginTree) { - s, ok := childTree.Origin.([]any) - if !ok { - return - } - childOrigin := originFromSeq(s) - if childOrigin == nil || len(childOrigin.Fields) == 0 { +// setChildOriginKeys sets Origin.Key on the immediate children of a mapping, +// from the key node heading each one. +// +// This is the only origin data a node cannot supply for itself: UnmarshalYAML +// receives the value node, and Key is the position of the key above it. Each +// child sets its own children's keys in turn, so one level per call covers the +// tree. +func setChildOriginKeys(node *yaml.Node, container any, file string) { + if !originEnabledVar { return } - locs := make([]Location, 0, len(childOrigin.Fields)) - for _, loc := range childOrigin.Fields { - locs = append(locs, loc) - } - sort.Slice(locs, func(i, j int) bool { return locs[i].Name < locs[j].Name }) - if parentOrigin.Sequences == nil { - parentOrigin.Sequences = make(map[string][]Location) - } - parentOrigin.Sequences[field] = locs -} - -// applyOrigins walks a Go struct tree and a parallel OriginTree, setting -// Origin fields on each struct from the extracted origin data. -func applyOrigins(v any, tree *yaml.OriginTree) { - if tree == nil { + if node == nil || node.Kind != yaml.MappingNode { return } - applyOriginsToValue(reflect.ValueOf(v), tree) -} - -func applyOriginsToValue(val reflect.Value, tree *yaml.OriginTree) { - // Keep track of the last pointer so we can pass it to struct handlers - // (needed for calling methods like Map() on maplike types). - var ptr reflect.Value - for val.Kind() == reflect.Pointer || val.Kind() == reflect.Interface { - if val.IsNil() { + v := reflect.ValueOf(container) + for v.Kind() == reflect.Pointer || v.Kind() == reflect.Interface { + if v.IsNil() { return } - if val.Kind() == reflect.Pointer { - ptr = val - } - val = val.Elem() + v = v.Elem() } + for i := 0; i+1 < len(node.Content); i += 2 { + keyNode, valNode := node.Content[i], node.Content[i+1] + child := childByKey(v, keyNode.Value) + if !child.IsValid() { + continue + } + setOriginKey(child, keyNode, file) - switch val.Kind() { - case reflect.Struct: - applyOriginsToStruct(val, ptr, tree) - case reflect.Map: - applyOriginsToMap(val, tree) - case reflect.Slice: - applyOriginsToSlice(val, tree) - } -} - -func applyOriginsToStruct(val reflect.Value, ptr reflect.Value, tree *yaml.OriginTree) { - typ := val.Type() - - // Set Origin field for structs whose Origin field has a "-" json tag. - var structOrigin *Origin - if tree.Origin != nil { - if sf, ok := typ.FieldByName("Origin"); ok && sf.Type == originPtrType { - tag := sf.Tag.Get("json") - if tag == "-" { - if s, ok := tree.Origin.([]any); ok { - structOrigin = originFromSeq(s) - val.FieldByName("Origin").Set(reflect.ValueOf(structOrigin)) + switch c := deref(child); c.Kind() { + case reflect.Map: + // A map-valued field (Content, Headers, Links) holds children of + // its own, keyed in valNode. The generic map decoder gives them no + // hook of their own, so descend. + if c.CanInterface() { + setChildOriginKeys(valNode, c.Interface(), file) + } + case reflect.Slice: + // A sequence item has no key above it, so it takes its own first + // key as its Key. + if valNode.Kind != yaml.SequenceNode { + continue + } + for j := 0; j < len(valNode.Content) && j < c.Len(); j++ { + item := valNode.Content[j] + if item.Kind == yaml.MappingNode && len(item.Content) > 0 { + setOriginKey(c.Index(j), item.Content[0], file) } } } } +} - // Recurse into exported struct fields using json tags - for i := range typ.NumField() { - sf := typ.Field(i) - if !sf.IsExported() { - continue +func deref(v reflect.Value) reflect.Value { + for v.Kind() == reflect.Pointer || v.Kind() == reflect.Interface { + if v.IsNil() { + return v } - tag := jsonTagName(sf) - if tag == "" || tag == "-" { - continue - } - childTree := tree.Fields[tag] - if childTree == nil { - continue - } - // A scalar-valued map (e.g. OAuth scopes: map[string]string) decodes into - // a Go map that has no Origin field of its own, so its per-key locations — - // present in the child subtree — would otherwise be lost. Record them on - // this struct's Origin as a named sequence so a consumer can locate each - // entry by key. Object- or pointer-valued maps are excluded: their values - // carry their own Origin via the recursion below. - if structOrigin != nil && isScalarValuedMapField(val.Field(i)) { - recordMapKeyLocations(structOrigin, tag, childTree) - } - applyOriginsToValue(val.Field(i), childTree) + v = v.Elem() } + return v +} - // Handle wrapper types whose inner struct has no json tag: - // - *Ref types (e.g. SchemaRef, ResponseRef) have a "Value" field - // - BoolSchema (AdditionalProperties, UnevaluatedProperties, UnevaluatedItems) has a "Schema" field - // The origin tree data applies to the inner struct, not a sub-key. - for _, fieldName := range []string{"Value", "Schema"} { - vf := val.FieldByName(fieldName) - if !vf.IsValid() || vf.Kind() != reflect.Pointer || vf.IsNil() { - continue +// childByKey finds the struct field or map entry a mapping key decoded into. +func childByKey(v reflect.Value, key string) reflect.Value { + switch v.Kind() { + case reflect.Map: + if v.IsNil() { + return reflect.Value{} } - sf, _ := typ.FieldByName(fieldName) - if sf.Tag.Get("json") == "" { - applyOriginsToValue(vf, tree) + return v.MapIndex(reflect.ValueOf(key)) + case reflect.Struct: + t := v.Type() + for i := range t.NumField() { + f := t.Field(i) + if !f.IsExported() { + continue + } + if name, _, _ := strings.Cut(f.Tag.Get("yaml"), ","); name == key { + return v.Field(i) + } } } + return reflect.Value{} +} - // Handle "maplike" types (Paths, Responses, Callback) whose items are - // stored in an unexported map accessible via a Map() method. - // Use the original pointer (if available) since dereferenced values - // are not addressable. - receiver := val - if ptr.IsValid() { - receiver = ptr - } else if val.CanAddr() { - receiver = val.Addr() +// setOriginKey stamps Key on a child carrying an *Origin, from the key's own +// position. The extent of what the key heads is the consumer's to derive. +func setOriginKey(child reflect.Value, keyNode *yaml.Node, file string) { + if !originEnabledVar { + return } - if receiver.Kind() == reflect.Pointer { - if mapMethod := receiver.MethodByName("Map"); mapMethod.IsValid() { - results := mapMethod.Call(nil) - if len(results) == 1 { - applyOriginsToMap(results[0], tree) - } + for child.Kind() == reflect.Pointer || child.Kind() == reflect.Interface { + if child.IsNil() { + return } + child = child.Elem() + } + if child.Kind() != reflect.Struct { + return + } + f := child.FieldByName("Origin") + if !f.IsValid() || f.Type() != originPtrType || !f.CanSet() { + // No origin of its own; it may still wrap something that has one. + descendToWrapped(child, keyNode, file) + return + } + if f.IsNil() { + f.Set(reflect.ValueOf(&Origin{})) } + f.Interface().(*Origin).Key = &Location{ + File: file, + Line: keyNode.Line, + Column: keyNode.Column, + Name: keyNode.Value, + } + // A wrapper and the thing it holds occupy the same node, so both carry + // that node's origin. Value is the $ref wrappers; Schema is BoolSchema, + // which holds either a bool or a schema. + descendToWrapped(child, keyNode, file) } -func applyOriginsToMap(val reflect.Value, tree *yaml.OriginTree) { - if tree.Fields == nil { +// descendToWrapped stamps the thing a wrapper holds, which occupies the same +// node. Value is the $ref wrappers; Schema is BoolSchema, which holds either a +// bool or a schema. +func descendToWrapped(child reflect.Value, keyNode *yaml.Node, file string) { + if child.Kind() != reflect.Struct { return } - for _, key := range val.MapKeys() { - childTree := tree.Fields[key.String()] - if childTree == nil { - continue - } - elem := val.MapIndex(key) - // Map values are not addressable. For pointer-typed values we can - // recurse directly. For value types we must copy, apply, and set back. - if elem.Kind() == reflect.Pointer || elem.Kind() == reflect.Interface { - applyOriginsToValue(elem, childTree) - } else if elem.Kind() == reflect.Struct { - // Copy to a settable value - cp := reflect.New(elem.Type()).Elem() - cp.Set(elem) - applyOriginsToStruct(cp, reflect.Value{}, childTree) - val.SetMapIndex(key, cp) + for _, name := range [...]string{"Value", "Schema"} { + if inner := child.FieldByName(name); inner.IsValid() { + setOriginKey(inner, keyNode, file) } } } -func applyOriginsToSlice(val reflect.Value, tree *yaml.OriginTree) { - for i := 0; i < val.Len() && i < len(tree.Items); i++ { - if tree.Items[i] != nil { - applyOriginsToValue(val.Index(i), tree.Items[i]) +// stampRootOrigin gives a document root the position of the document itself. +// +// Origin.Key is normally the key heading a mapping in its parent, stamped by +// that parent. A root has none -- an externally $ref'd file may be a bare +// schema -- so it takes the root node's own position and an empty name. +// Applied only when nothing has already set Key, so a type that supplies its +// own keeps it. +func stampRootOrigin(v any, node *yaml.Node) { + if !originEnabledVar || node == nil { + return + } + rv := reflect.ValueOf(v) + for rv.Kind() == reflect.Pointer || rv.Kind() == reflect.Interface { + if rv.IsNil() { + return } + rv = rv.Elem() } -} - -// jsonTagName returns the JSON field name from a struct field's json tag. -func jsonTagName(f reflect.StructField) string { - tag := f.Tag.Get("json") - if tag == "" { - return "" + if rv.Kind() != reflect.Struct { + return + } + f := rv.FieldByName("Origin") + if !f.IsValid() || f.Type() != originPtrType || !f.CanSet() || f.IsNil() { + return } - name, _, _ := strings.Cut(tag, ",") - return name + o := f.Interface().(*Origin) + if o.Key != nil { + return + } + o.Key = &Location{File: nativeOriginFile(), Line: node.Line, Column: node.Column} } - -// originTree aliases the decoder-side origin tree, so the loader and marsh can -// carry it without referencing the yaml package directly. -type originTree = goyaml.Node From 8e04ac1188789c9e9b44b4f69b0fd68c8109d374 Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 19:38:09 +0300 Subject: [PATCH 21/31] Use the stock parser directly in openapi3 github.com/oasdiff/yaml3 is a fork of the same upstream as go.yaml.in/yaml/v3 and exposes the same API, so these are import swaps. openapi3 and openapi3filter no longer reference it. The go.mod entries stay: openapi2 and cmd/validate still use the wrapper, and openapi2 is out of scope here. Noted on the PR as a follow-up. Two test files still use the wrapper's Unmarshal, which takes DecodeOpts and has no stock equivalent; they need rewriting rather than swapping. Verified neutral: openapi3 unchanged at 18 failures, openapi3filter at 1 before and after. --- openapi3/additionalProperties_test.go | 2 +- openapi3/issue241_test.go | 2 +- openapi3/issue883_test.go | 2 +- openapi3/issue972_test.go | 2 +- openapi3/schema_test.go | 2 +- openapi3filter/req_resp_decoder.go | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/openapi3/additionalProperties_test.go b/openapi3/additionalProperties_test.go index ac55b1d30..85ea9beb1 100644 --- a/openapi3/additionalProperties_test.go +++ b/openapi3/additionalProperties_test.go @@ -5,8 +5,8 @@ import ( "os" "testing" - yaml "github.com/oasdiff/yaml3" "github.com/stretchr/testify/require" + yaml "go.yaml.in/yaml/v3" "github.com/getkin/kin-openapi/openapi3" ) diff --git a/openapi3/issue241_test.go b/openapi3/issue241_test.go index caf9a7e08..8dcc9db9a 100644 --- a/openapi3/issue241_test.go +++ b/openapi3/issue241_test.go @@ -5,8 +5,8 @@ import ( "os" "testing" - yaml "github.com/oasdiff/yaml3" "github.com/stretchr/testify/require" + yaml "go.yaml.in/yaml/v3" "github.com/getkin/kin-openapi/openapi3" ) diff --git a/openapi3/issue883_test.go b/openapi3/issue883_test.go index 1ff5dee5f..faa1adb00 100644 --- a/openapi3/issue883_test.go +++ b/openapi3/issue883_test.go @@ -4,8 +4,8 @@ import ( "testing" yaml "github.com/oasdiff/yaml" - yamlv3 "github.com/oasdiff/yaml3" "github.com/stretchr/testify/require" + yamlv3 "go.yaml.in/yaml/v3" "github.com/getkin/kin-openapi/openapi3" ) diff --git a/openapi3/issue972_test.go b/openapi3/issue972_test.go index 6bb274893..121b44dda 100644 --- a/openapi3/issue972_test.go +++ b/openapi3/issue972_test.go @@ -3,8 +3,8 @@ package openapi3_test import ( "testing" - yaml "github.com/oasdiff/yaml3" "github.com/stretchr/testify/assert" + yaml "go.yaml.in/yaml/v3" "github.com/getkin/kin-openapi/openapi3" ) diff --git a/openapi3/schema_test.go b/openapi3/schema_test.go index cc28eb128..490a3e15e 100644 --- a/openapi3/schema_test.go +++ b/openapi3/schema_test.go @@ -9,8 +9,8 @@ import ( "strings" "testing" - yaml "github.com/oasdiff/yaml3" "github.com/stretchr/testify/require" + yaml "go.yaml.in/yaml/v3" ) type schemaExample struct { diff --git a/openapi3filter/req_resp_decoder.go b/openapi3filter/req_resp_decoder.go index 702adbc84..857b1e59d 100644 --- a/openapi3filter/req_resp_decoder.go +++ b/openapi3filter/req_resp_decoder.go @@ -19,7 +19,7 @@ import ( "strconv" "strings" - yaml "github.com/oasdiff/yaml3" + yaml "go.yaml.in/yaml/v3" "github.com/getkin/kin-openapi/openapi3" ) From ca4456d394940b3502d7ec3188f7ced98080b27b Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 19:45:36 +0300 Subject: [PATCH 22/31] Normalise any-element slices and maps, and accept int in an enum normalizeAnyFields handled fields of type any but not []any or map[string]any, so an integer example became a float64 while the enum it must match stayed an int, and a schema failed against its own allowed values. openapi3filter caught it; openapi3 did not. Fixing that surfaced a gap in the enum comparison: it converts json.Number and int64 to float64 before comparing, but falls through to an exact DeepEqual for a plain int. A Go int passed to VisitJSON therefore never matched a float64 enum, which is what a document loaded as JSON has always produced. Added the case alongside int64. TestIssue646 exercised that path only because it decoded with the raw yaml parser, which bypasses the unmarshalers and left the enum as ints on both sides. Going through UnmarshalYAML gives it JSON-shaped numbers like any other document, so it now compares an int against a float64 enum -- the case a caller loading real JSON hits. openapi3filter 1 -> 0. openapi3 unchanged at 18. --- openapi3/native_yaml.go | 35 ++- openapi3/schema.go | 4 + .../bigredcloud_com_v1_openapi_yaml__validate | 16 +- ...a_holidays_ca_1_8_0_openapi_yaml__validate | 26 --- ...dataflowkit_com_1_3_openapi_yaml__validate | 44 +--- .../dodo_ac_1_6_0_openapi_yaml__validate | 39 ++-- ...dracoon_team_4_42_3_openapi_yaml__validate | 13 +- .../exavault_com_2_0_openapi_yaml__validate | 15 +- ...c_ca_geocoder_2_0_0_openapi_yaml__validate | 19 -- ...bc_ca_geomark_4_1_2_openapi_yaml__validate | 20 -- ...ca_jobposting_1_0_0_openapi_yaml__validate | 2 +- ..._bc_ca_router_2_0_0_openapi_yaml__validate | 19 -- ...ndhog_day_com_1_2_1_openapi_yaml__validate | 32 --- .../mbus_local_0_3_5_openapi_yaml__validate | 19 +- .../meraki_com_1_32_0_openapi_yaml__validate | 13 -- .../mineskin_org_1_0_0_openapi_yaml__validate | 14 -- ...umber_insight_1_2_1_openapi_yaml__validate | 17 +- ..._com_numbers_1_0_20_openapi_yaml__validate | 14 -- ...s_com_geo_api_1_0_0_openapi_yaml__validate | 13 -- ...andascore_co_2_23_1_openapi_yaml__validate | 204 +----------------- ...pdfblocks_com_1_5_0_openapi_yaml__validate | 20 -- ...eratorapi_com_3_1_1_openapi_yaml__validate | 15 +- .../slmonitor_com_2_1_openapi_yaml__validate | 18 -- .../sms77_io_1_0_0_openapi_yaml__validate | 12 +- ...mtom_com_maps_1_0_0_openapi_yaml__validate | 29 --- ...sight_local_11_1_00_openapi_yaml__validate | 15 -- .../viator_com_1_0_0_openapi_yaml__validate | 28 --- ...ge_Center_API_1_0_0_openapi_yaml__validate | 11 - ...es_System_API_1_0_0_openapi_yaml__validate | 126 ++++++++++- .../zoom_us_2_0_0_openapi_yaml__validate | 59 +++-- 30 files changed, 256 insertions(+), 655 deletions(-) delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/canada_holidays_ca_1_8_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_geocoder_2_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_geomark_4_1_2_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_router_2_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/groundhog_day_com_1_2_1_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/meraki_com_1_32_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/mineskin_org_1_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/nexmo_com_numbers_1_0_20_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/nytimes_com_geo_api_1_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/pdfblocks_com_1_5_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/slmonitor_com_2_1_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/tomtom_com_maps_1_0_0_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/truesight_local_11_1_00_openapi_yaml__validate delete mode 100644 openapi3/testdata/apis_guru_openapi_directory/vtex_local_Message_Center_API_1_0_0_openapi_yaml__validate diff --git a/openapi3/native_yaml.go b/openapi3/native_yaml.go index f24071ef3..3b38300da 100644 --- a/openapi3/native_yaml.go +++ b/openapi3/native_yaml.go @@ -65,7 +65,10 @@ func normalizeNumbers(v any) any { } // normalizeAnyFields applies normalizeNumbers to a struct's any-typed fields, -// which the decoder fills directly (Example, Default and the like). +// which the decoder fills directly: Example and Default, but also Enum, whose +// element type is any. Missing the slice case left an integer example as a +// float64 and the enum it must match as an int, so a schema failed against its +// own allowed values. func normalizeAnyFields(out any) { v := reflect.ValueOf(out) for v.Kind() == reflect.Pointer { @@ -79,8 +82,34 @@ func normalizeAnyFields(out any) { } for i := range v.NumField() { f := v.Field(i) - if f.Kind() == reflect.Interface && f.CanSet() && !f.IsNil() { - f.Set(reflect.ValueOf(normalizeNumbers(f.Interface()))) + if !f.CanSet() { + continue + } + switch f.Kind() { + case reflect.Interface: + if !f.IsNil() { + f.Set(reflect.ValueOf(normalizeNumbers(f.Interface()))) + } + case reflect.Slice, reflect.Map: + // []any and map[string]any: normalise the elements in place. + if f.Type().Elem().Kind() != reflect.Interface || f.IsNil() { + continue + } + if f.Kind() == reflect.Slice { + for j := range f.Len() { + e := f.Index(j) + if !e.IsNil() { + e.Set(reflect.ValueOf(normalizeNumbers(e.Interface()))) + } + } + continue + } + for _, k := range f.MapKeys() { + e := f.MapIndex(k) + if !e.IsNil() { + f.SetMapIndex(k, reflect.ValueOf(normalizeNumbers(e.Interface()))) + } + } } } } diff --git a/openapi3/schema.go b/openapi3/schema.go index 4388a3981..e4e7f3487 100644 --- a/openapi3/schema.go +++ b/openapi3/schema.go @@ -2063,6 +2063,10 @@ func (schema *Schema) visitEnumOperation(settings *schemaValidationSettings, val if v == f { return } + case int: + if v == float64(c) { + return + } case int64: if v == float64(c) { return diff --git a/openapi3/testdata/apis_guru_openapi_directory/bigredcloud_com_v1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/bigredcloud_com_v1_openapi_yaml__validate index 805d03053..ecf6ae60c 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/bigredcloud_com_v1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/bigredcloud_com_v1_openapi_yaml__validate @@ -1,15 +1 @@ -invalid components: schema "BatchItem_BankAccountDto_": invalid example: Error at "/opCode": value is not one of the allowed values [1,2,3] -Schema: - { - "description": "1 - Create\r\n2 - Update\r\n3 - Delete", - "enum": [ - 1, - 2, - 3 - ], - "format": "int32", - "type": "integer" - } - -Value: - 1 +invalid components: schema "BatchItem_CashPaymentDto_": invalid example: Error at "/entryDate": string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" | Error at "/procDate": string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" diff --git a/openapi3/testdata/apis_guru_openapi_directory/canada_holidays_ca_1_8_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/canada_holidays_ca_1_8_0_openapi_yaml__validate deleted file mode 100644 index a039ec5a6..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/canada_holidays_ca_1_8_0_openapi_yaml__validate +++ /dev/null @@ -1,26 +0,0 @@ -invalid paths: invalid path /api/v1/holidays: invalid operation GET: invalid example: example /holidays: Error at "/holidays/0/federal": value is not one of the allowed values [1,0] -Schema: - { - "description": "Whether this holiday is observed by federally-regulated industries.", - "enum": [ - 1, - 0 - ], - "type": "integer" - } - -Value: - 1 - | Error at "/holidays/1/federal": value is not one of the allowed values [1,0] -Schema: - { - "description": "Whether this holiday is observed by federally-regulated industries.", - "enum": [ - 1, - 0 - ], - "type": "integer" - } - -Value: - 0 diff --git a/openapi3/testdata/apis_guru_openapi_directory/dataflowkit_com_1_3_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/dataflowkit_com_1_3_openapi_yaml__validate index e4f9dd9c2..e93714ed7 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/dataflowkit_com_1_3_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/dataflowkit_com_1_3_openapi_yaml__validate @@ -1,46 +1,4 @@ -invalid components: schema "field": invalid allOf element: invalid example: Error at "/fields/0/type": value is not one of the allowed values [0,1,2] -Schema: - { - "description": "Selector type. ( 0 - image, 1 - text, 2 - link)", - "enum": [ - 0, - 1, - 2 - ], - "type": "integer" - } - -Value: - 1 - | Error at "/fields/1/type": value is not one of the allowed values [0,1,2] -Schema: - { - "description": "Selector type. ( 0 - image, 1 - text, 2 - link)", - "enum": [ - 0, - 1, - 2 - ], - "type": "integer" - } - -Value: - 2 - | Error at "/fields/2/type": value is not one of the allowed values [0,1,2] -Schema: - { - "description": "Selector type. ( 0 - image, 1 - text, 2 - link)", - "enum": [ - 0, - 1, - 2 - ], - "type": "integer" - } - -Value: - 0 - | Error at "/proxy": property "proxy" is missing +invalid components: schema "field": invalid allOf element: invalid example: Error at "/proxy": property "proxy" is missing Schema: { "example": { diff --git a/openapi3/testdata/apis_guru_openapi_directory/dodo_ac_1_6_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/dodo_ac_1_6_0_openapi_yaml__validate index cc9030521..60805961a 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/dodo_ac_1_6_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/dodo_ac_1_6_0_openapi_yaml__validate @@ -1,21 +1,32 @@ -invalid components: schema "NHClothing": invalid example: value is not one of the allowed values [0,1,2,3,4,5,6,7,8] +invalid components: schema "NHInterior": invalid example: value is not one of the allowed values ["Aqua","Beige","Black","Blue","Brown","Colorful","Gray","Green","Orange","Pink","Purple","Red","White","Yellow"] Schema: { - "description": "The total number of variations the clothing has, between 0 and 8.", + "description": "(WIP)", "enum": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8 + "Aqua", + "Beige", + "Black", + "Blue", + "Brown", + "Colorful", + "Gray", + "Green", + "Orange", + "Pink", + "Purple", + "Red", + "White", + "Yellow" ], - "example": 2, - "type": "integer" + "example": [ + "White", + "Colorful" + ], + "type": "string" } Value: - 2 + [ + "White", + "Colorful" + ] diff --git a/openapi3/testdata/apis_guru_openapi_directory/dracoon_team_4_42_3_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/dracoon_team_4_42_3_openapi_yaml__validate index f6c884b87..238b2c433 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/dracoon_team_4_42_3_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/dracoon_team_4_42_3_openapi_yaml__validate @@ -1,17 +1,10 @@ -invalid components: schema "ConfigRoomRequest": invalid default: value is not one of the allowed values [1,2,3,4] +invalid paths: invalid path /v4/auth/login: invalid operation POST: invalid example: example null: Error at "/errorCode": Value is not nullable Schema: { - "default": 2, - "description": "Classification ID:\n\n* `1` - public\n\n* `2` - internal\n\n* `3` - confidential\n\n* `4` - strictly confidential\n\n\n\nProvided (or default) classification is taken from room\n\nwhen file gets uploaded without any classification.", - "enum": [ - 1, - 2, - 3, - 4 - ], + "description": "Internal error code", "format": "int32", "type": "integer" } Value: - 2 + null diff --git a/openapi3/testdata/apis_guru_openapi_directory/exavault_com_2_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/exavault_com_2_0_openapi_yaml__validate index 9698b2977..d02359ba1 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/exavault_com_2_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/exavault_com_2_0_openapi_yaml__validate @@ -1,15 +1,10 @@ -invalid components: schema "Account": invalid example: value is not one of the allowed values [1,0] +invalid components: schema "Error": invalid example: value must be an object Schema: { - "description": "Account status flag. A one (1) means the account is active; zero (0) means it is suspended.", - "enum": [ - 1, - 0 - ], - "example": 1, - "format": "int32", - "type": "integer" + "description": "Meta object containing non-standard meta-information about the error.", + "example": "\u003c_META_OBJECT\u003e", + "type": "object" } Value: - 1 + "\u003c_META_OBJECT\u003e" diff --git a/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_geocoder_2_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_geocoder_2_0_0_openapi_yaml__validate deleted file mode 100644 index 645e55c08..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_geocoder_2_0_0_openapi_yaml__validate +++ /dev/null @@ -1,19 +0,0 @@ -invalid paths: invalid path /addresses.{outputFormat}: invalid operation GET: parameter "outputSRS" schema is invalid: invalid default: value is not one of the allowed values [4326,4269,3005,26907,26908,26909,26910,26911] -Schema: - { - "default": 4326, - "enum": [ - 4326, - 4269, - 3005, - 26907, - 26908, - 26909, - 26910, - 26911 - ], - "type": "integer" - } - -Value: - 4326 diff --git a/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_geomark_4_1_2_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_geomark_4_1_2_openapi_yaml__validate deleted file mode 100644 index 62eb501a0..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_geomark_4_1_2_openapi_yaml__validate +++ /dev/null @@ -1,20 +0,0 @@ -invalid paths: invalid path /geomarks/new: invalid operation POST: invalid default: value is not one of the allowed values [4326,3005,3857,26907,26908,26909,26910,26911] -Schema: - { - "default": 4326, - "description": "The srid of the coordinate system the input geometries are in. If the file includes a coordinate system definition that will be used.", - "enum": [ - 4326, - 3005, - 3857, - 26907, - 26908, - 26909, - 26910, - 26911 - ], - "type": "integer" - } - -Value: - 4326 diff --git a/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_jobposting_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_jobposting_1_0_0_openapi_yaml__validate index 62fdedad0..e28252e53 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_jobposting_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_jobposting_1_0_0_openapi_yaml__validate @@ -1,4 +1,4 @@ -invalid paths: invalid path /jobs: invalid operation POST: invalid default: value is not one of the allowed values [[1],[2]] +invalid paths: invalid path /jobs: invalid operation POST: invalid default: value must be an integer Schema: { "default": [ diff --git a/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_router_2_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_router_2_0_0_openapi_yaml__validate deleted file mode 100644 index 72771ff72..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/gov_bc_ca_router_2_0_0_openapi_yaml__validate +++ /dev/null @@ -1,19 +0,0 @@ -invalid paths: invalid path /directions.{outputFormat}: invalid operation GET: parameter "outputSRS" schema is invalid: invalid default: value is not one of the allowed values [4326,4269,3005,26907,26908,26909,26910,26911] -Schema: - { - "default": 4326, - "enum": [ - 4326, - 4269, - 3005, - 26907, - 26908, - 26909, - 26910, - 26911 - ], - "type": "integer" - } - -Value: - 4326 diff --git a/openapi3/testdata/apis_guru_openapi_directory/groundhog_day_com_1_2_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/groundhog_day_com_1_2_1_openapi_yaml__validate deleted file mode 100644 index 593b0cd7f..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/groundhog_day_com_1_2_1_openapi_yaml__validate +++ /dev/null @@ -1,32 +0,0 @@ -invalid paths: invalid path /api/v1/groundhogs: invalid operation GET: invalid example: example /groundhogs: Error at "/groundhogs/0/active": value is not one of the allowed values [0,1] -Schema: - { - "enum": [ - 0, - 1 - ], - "exclusiveMaximum": false, - "exclusiveMinimum": false, - "maximum": 1, - "minimum": 0, - "type": "integer" - } - -Value: - 1 - | Error at "/groundhogs/1/active": value is not one of the allowed values [0,1] -Schema: - { - "enum": [ - 0, - 1 - ], - "exclusiveMaximum": false, - "exclusiveMinimum": false, - "maximum": 1, - "minimum": 0, - "type": "integer" - } - -Value: - 1 diff --git a/openapi3/testdata/apis_guru_openapi_directory/mbus_local_0_3_5_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/mbus_local_0_3_5_openapi_yaml__validate index be40eeeb7..a7790bb55 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/mbus_local_0_3_5_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/mbus_local_0_3_5_openapi_yaml__validate @@ -1,19 +1,10 @@ -invalid components: schema "baudrate": invalid example: value is not one of the allowed values [300,600,1200,2400,4800,9600] +invalid components: schema "hat": invalid example: value must be a string Schema: { - "description": "Baudrate to use for the communication - valid values 300, 600, 1200, 2400, 4800, 9600", - "enum": [ - 300, - 600, - 1200, - 2400, - 4800, - 9600 - ], - "example": 2400, - "format": "int32", - "type": "integer" + "description": "Product ID", + "example": 1, + "type": "string" } Value: - 2400 + 1 diff --git a/openapi3/testdata/apis_guru_openapi_directory/meraki_com_1_32_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/meraki_com_1_32_0_openapi_yaml__validate deleted file mode 100644 index 7787237ac..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/meraki_com_1_32_0_openapi_yaml__validate +++ /dev/null @@ -1,13 +0,0 @@ -invalid paths: invalid path /devices/{serial}/camera/qualityAndRetention: invalid operation PUT: invalid example: Error at "/motionDetectorVersion": value is not one of the allowed values [1,2] -Schema: - { - "description": "The version of the motion detector that will be used by the camera. Only applies to Gen 2 cameras. Defaults to v2.", - "enum": [ - 1, - 2 - ], - "type": "integer" - } - -Value: - 2 diff --git a/openapi3/testdata/apis_guru_openapi_directory/mineskin_org_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/mineskin_org_1_0_0_openapi_yaml__validate deleted file mode 100644 index 5ebd6318e..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/mineskin_org_1_0_0_openapi_yaml__validate +++ /dev/null @@ -1,14 +0,0 @@ -invalid components: schema "GenerateOptions": invalid default: value is not one of the allowed values [0,1] -Schema: - { - "default": 0, - "description": "Visibility of the generated skin. 0 for public, 1 for private", - "enum": [ - 0, - 1 - ], - "type": "integer" - } - -Value: - 0 diff --git a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_number_insight_1_2_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_number_insight_1_2_1_openapi_yaml__validate index ce1d8ac16..cf28034f0 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_number_insight_1_2_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_number_insight_1_2_1_openapi_yaml__validate @@ -1,17 +1,12 @@ -invalid components: schema "niBasicStatus": invalid example: value is not one of the allowed values [0,1,3,4,5,9] +invalid components: schema "niResponseXmlAdvanced": invalid example: value must be a string Schema: { - "description": "Code | Text\n-- | --\n0 | Success - request accepted for delivery by .\n1 | Busy - you have made more requests in the last second than are permitted by your account. Please retry.\n3 | Invalid - your request is incomplete and missing some mandatory parameters.\n4 | Invalid credentials - the _api_key_ or _api_secret_ you supplied is either not valid or has been disabled.\n5 | Internal Error - the format of the recipient address is not valid.\n9 | Partner quota exceeded - your account does not have sufficient credit to process this request.\n", - "enum": [ - 0, - 1, - 3, - 4, - 5, - 9 - ], + "description": "The status code", "example": 0, - "type": "integer" + "type": "string", + "xml": { + "attribute": true + } } Value: diff --git a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_numbers_1_0_20_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_numbers_1_0_20_openapi_yaml__validate deleted file mode 100644 index d065666f3..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/nexmo_com_numbers_1_0_20_openapi_yaml__validate +++ /dev/null @@ -1,14 +0,0 @@ -invalid components: parameter "search_pattern": parameter "search_pattern" schema is invalid: invalid default: value is not one of the allowed values [0,1,2] -Schema: - { - "default": 0, - "enum": [ - 0, - 1, - 2 - ], - "type": "integer" - } - -Value: - 0 diff --git a/openapi3/testdata/apis_guru_openapi_directory/nytimes_com_geo_api_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/nytimes_com_geo_api_1_0_0_openapi_yaml__validate deleted file mode 100644 index 29bd50019..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/nytimes_com_geo_api_1_0_0_openapi_yaml__validate +++ /dev/null @@ -1,13 +0,0 @@ -invalid paths: invalid path /query.json: invalid operation GET: parameter "facets" schema is invalid: invalid default: value is not one of the allowed values [0,1] -Schema: - { - "default": 0, - "enum": [ - 0, - 1 - ], - "type": "integer" - } - -Value: - 0 diff --git a/openapi3/testdata/apis_guru_openapi_directory/pandascore_co_2_23_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/pandascore_co_2_23_1_openapi_yaml__validate index 123e362e9..a3b23feea 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/pandascore_co_2_23_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/pandascore_co_2_23_1_openapi_yaml__validate @@ -6990,17 +6990,7 @@ Value: "name": "Dota 2", "slug": "dota-2" } - Or Error at "/id": value is not one of the allowed values [4] -Schema: - { - "enum": [ - 4 - ] - } - -Value: - 4 - | Error at "/current_version": property "current_version" is missing + Or Error at "/current_version": property "current_version" is missing Schema: { "additionalProperties": false, @@ -9688,70 +9678,6 @@ Schema: Value: null - | Error at "/object/videogame": value is not one of the allowed values [{"id":1,"name":"LoL","slug":"league-of-legends"},{"id":3,"name":"CS:GO","slug":"cs-go"},{"id":4,"name":"Dota 2","slug":"dota-2"},{"id":14,"name":"Overwatch","slug":"ow"},{"id":20,"name":"PUBG","slug":"pubg"},{"id":22,"name":"Rocket League","slug":"rl"},{"id":23,"name":"Call of Duty","slug":"cod-mw"},{"id":24,"name":"Rainbow 6 Siege","slug":"r6-siege"},{"id":25,"name":"FIFA","slug":"fifa"},{"id":26,"name":"Valorant","slug":"valorant"}] -Schema: - { - "enum": [ - { - "id": 1, - "name": "LoL", - "slug": "league-of-legends" - }, - { - "id": 3, - "name": "CS:GO", - "slug": "cs-go" - }, - { - "id": 4, - "name": "Dota 2", - "slug": "dota-2" - }, - { - "id": 14, - "name": "Overwatch", - "slug": "ow" - }, - { - "id": 20, - "name": "PUBG", - "slug": "pubg" - }, - { - "id": 22, - "name": "Rocket League", - "slug": "rl" - }, - { - "id": 23, - "name": "Call of Duty", - "slug": "cod-mw" - }, - { - "id": 24, - "name": "Rainbow 6 Siege", - "slug": "r6-siege" - }, - { - "id": 25, - "name": "FIFA", - "slug": "fifa" - }, - { - "id": 26, - "name": "Valorant", - "slug": "valorant" - } - ], - "type": "object" - } - -Value: - { - "id": 4, - "name": "Dota 2", - "slug": "dota-2" - } | Error at "/object/videogame_version": doesn't match schema due to: Value is not nullable Schema: { @@ -31706,70 +31632,6 @@ Value: "winner": null, "winner_id": null } - | Error at "/object/videogame": value is not one of the allowed values [{"id":1,"name":"LoL","slug":"league-of-legends"},{"id":3,"name":"CS:GO","slug":"cs-go"},{"id":4,"name":"Dota 2","slug":"dota-2"},{"id":14,"name":"Overwatch","slug":"ow"},{"id":20,"name":"PUBG","slug":"pubg"},{"id":22,"name":"Rocket League","slug":"rl"},{"id":23,"name":"Call of Duty","slug":"cod-mw"},{"id":24,"name":"Rainbow 6 Siege","slug":"r6-siege"},{"id":25,"name":"FIFA","slug":"fifa"},{"id":26,"name":"Valorant","slug":"valorant"}] -Schema: - { - "enum": [ - { - "id": 1, - "name": "LoL", - "slug": "league-of-legends" - }, - { - "id": 3, - "name": "CS:GO", - "slug": "cs-go" - }, - { - "id": 4, - "name": "Dota 2", - "slug": "dota-2" - }, - { - "id": 14, - "name": "Overwatch", - "slug": "ow" - }, - { - "id": 20, - "name": "PUBG", - "slug": "pubg" - }, - { - "id": 22, - "name": "Rocket League", - "slug": "rl" - }, - { - "id": 23, - "name": "Call of Duty", - "slug": "cod-mw" - }, - { - "id": 24, - "name": "Rainbow 6 Siege", - "slug": "r6-siege" - }, - { - "id": 25, - "name": "FIFA", - "slug": "fifa" - }, - { - "id": 26, - "name": "Valorant", - "slug": "valorant" - } - ], - "type": "object" - } - -Value: - { - "id": 4, - "name": "Dota 2", - "slug": "dota-2" - } | Error at "/object": property "videogame_version" is unsupported Schema: { @@ -52210,70 +52072,6 @@ Value: "winner": null, "winner_id": null } - | Error at "/object/videogame": value is not one of the allowed values [{"id":1,"name":"LoL","slug":"league-of-legends"},{"id":3,"name":"CS:GO","slug":"cs-go"},{"id":4,"name":"Dota 2","slug":"dota-2"},{"id":14,"name":"Overwatch","slug":"ow"},{"id":20,"name":"PUBG","slug":"pubg"},{"id":22,"name":"Rocket League","slug":"rl"},{"id":23,"name":"Call of Duty","slug":"cod-mw"},{"id":24,"name":"Rainbow 6 Siege","slug":"r6-siege"},{"id":25,"name":"FIFA","slug":"fifa"},{"id":26,"name":"Valorant","slug":"valorant"}] -Schema: - { - "enum": [ - { - "id": 1, - "name": "LoL", - "slug": "league-of-legends" - }, - { - "id": 3, - "name": "CS:GO", - "slug": "cs-go" - }, - { - "id": 4, - "name": "Dota 2", - "slug": "dota-2" - }, - { - "id": 14, - "name": "Overwatch", - "slug": "ow" - }, - { - "id": 20, - "name": "PUBG", - "slug": "pubg" - }, - { - "id": 22, - "name": "Rocket League", - "slug": "rl" - }, - { - "id": 23, - "name": "Call of Duty", - "slug": "cod-mw" - }, - { - "id": 24, - "name": "Rainbow 6 Siege", - "slug": "r6-siege" - }, - { - "id": 25, - "name": "FIFA", - "slug": "fifa" - }, - { - "id": 26, - "name": "Valorant", - "slug": "valorant" - } - ], - "type": "object" - } - -Value: - { - "id": 4, - "name": "Dota 2", - "slug": "dota-2" - } | Error at "/object": property "videogame_version" is unsupported Schema: { diff --git a/openapi3/testdata/apis_guru_openapi_directory/pdfblocks_com_1_5_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/pdfblocks_com_1_5_0_openapi_yaml__validate deleted file mode 100644 index d8489d080..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/pdfblocks_com_1_5_0_openapi_yaml__validate +++ /dev/null @@ -1,20 +0,0 @@ -invalid paths: invalid path /v1/rotate_pages: invalid operation POST: invalid example: value is not one of the allowed values [0,90,180,270,-90,-180,-270] -Schema: - { - "description": "The angle of rotation of the pages. Positive angles rotate the pages clockwise. Negative angles rotate the pages counter-clockwise.", - "enum": [ - 0, - 90, - 180, - 270, - -90, - -180, - -270 - ], - "example": 90, - "format": "int32", - "type": "integer" - } - -Value: - 90 diff --git a/openapi3/testdata/apis_guru_openapi_directory/pdfgeneratorapi_com_3_1_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/pdfgeneratorapi_com_3_1_1_openapi_yaml__validate index d6fce76f2..678cfcb2d 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/pdfgeneratorapi_com_3_1_1_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/pdfgeneratorapi_com_3_1_1_openapi_yaml__validate @@ -1,16 +1,13 @@ -invalid components: schema "TemplateDefinition": invalid example: value is not one of the allowed values [0,90,180,270] +invalid components: response "error403": invalid example: value is not one of the allowed values ["Your account has exceeded the monthly document generation limit."] Schema: { - "description": "Page rotation in degrees", + "description": "Error description", "enum": [ - 0, - 90, - 180, - 270 + "Your account has exceeded the monthly document generation limit." ], - "example": 0, - "type": "integer" + "example": "Access not granted", + "type": "string" } Value: - 0 + "Access not granted" diff --git a/openapi3/testdata/apis_guru_openapi_directory/slmonitor_com_2_1_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/slmonitor_com_2_1_openapi_yaml__validate deleted file mode 100644 index 75e713650..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/slmonitor_com_2_1_openapi_yaml__validate +++ /dev/null @@ -1,18 +0,0 @@ -invalid paths: invalid path /api/v2.1/companies/{companyId}/users/{uniqueUserId}/checkin: invalid operation POST: parameter "deviceType" schema is invalid: invalid default: value is not one of the allowed values [1,2,3,4,5,10,11] -Schema: - { - "default": 10, - "enum": [ - 1, - 2, - 3, - 4, - 5, - 10, - 11 - ], - "type": "integer" - } - -Value: - 10 diff --git a/openapi3/testdata/apis_guru_openapi_directory/sms77_io_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/sms77_io_1_0_0_openapi_yaml__validate index 08f3a9060..ed571195e 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/sms77_io_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/sms77_io_1_0_0_openapi_yaml__validate @@ -1,13 +1,9 @@ -invalid paths: invalid path /contacts: invalid operation GET: parameter "json" schema is invalid: invalid default: value is not one of the allowed values [0,1] +invalid paths: invalid path /contacts: invalid operation POST: invalid example: value must be a string Schema: { - "default": 0, - "enum": [ - 0, - 1 - ], - "type": "number" + "example": 152, + "type": "string" } Value: - 0 + 152 diff --git a/openapi3/testdata/apis_guru_openapi_directory/tomtom_com_maps_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/tomtom_com_maps_1_0_0_openapi_yaml__validate deleted file mode 100644 index 9afd44f02..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/tomtom_com_maps_1_0_0_openapi_yaml__validate +++ /dev/null @@ -1,29 +0,0 @@ -invalid paths: invalid path /map/{versionNumber}/copyrights/{zoom}/{X}/{Y}.{format}: invalid operation GET: invalid example: value is not one of the allowed values [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18] -Schema: - { - "enum": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18 - ], - "type": "integer" - } - -Value: - 0 diff --git a/openapi3/testdata/apis_guru_openapi_directory/truesight_local_11_1_00_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/truesight_local_11_1_00_openapi_yaml__validate deleted file mode 100644 index 287b5b780..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/truesight_local_11_1_00_openapi_yaml__validate +++ /dev/null @@ -1,15 +0,0 @@ -invalid components: schema "ReinitializeActionConfiguration": invalid example: value is not one of the allowed values [0,1] -Schema: - { - "description": "When set to \u003cem\u003e1\u003c/em\u003e, removes all manually set Alert Actions and reverts to basic default actions i.e. trigger a PATROL event and annotate a parameter graph.", - "enum": [ - 0, - 1 - ], - "example": 1, - "format": "int32", - "type": "integer" - } - -Value: - 1 diff --git a/openapi3/testdata/apis_guru_openapi_directory/viator_com_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/viator_com_1_0_0_openapi_yaml__validate index b066a9c56..d6d4c760b 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/viator_com_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/viator_com_1_0_0_openapi_yaml__validate @@ -124,20 +124,6 @@ Value: { "$ref": "#/components/examples/product-example-1/value/data/pas" } - | Error at "/data/0/translationLevel": value is not one of the allowed values [0,80,100] -Schema: - { - "description": "**numeric indicator** of the language translation level for *this* product that is one of:\n- `0`: no translation (English only)\n- `80`: full machine translation\n- `100`: full human translation\n\nSee: [Working with human and machine translations](#section/Appendices/Working-with-human-and-machine-translations) for more information\n", - "enum": [ - 0, - 80, - 100 - ], - "type": "integer" - } - -Value: - 0 | Error at "/data/0/uniqueShortDescription": value must be a string Schema: { @@ -214,20 +200,6 @@ Value: { "$ref": "#/components/examples/product-example-1/value/data/pas" } - | Error at "/data/1/translationLevel": value is not one of the allowed values [0,80,100] -Schema: - { - "description": "**numeric indicator** of the language translation level for *this* product that is one of:\n- `0`: no translation (English only)\n- `80`: full machine translation\n- `100`: full human translation\n\nSee: [Working with human and machine translations](#section/Appendices/Working-with-human-and-machine-translations) for more information\n", - "enum": [ - 0, - 80, - 100 - ], - "type": "integer" - } - -Value: - 0 | Error at "/data/1/uniqueShortDescription": value must be a string Schema: { diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Message_Center_API_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Message_Center_API_1_0_0_openapi_yaml__validate deleted file mode 100644 index d3b73966b..000000000 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Message_Center_API_1_0_0_openapi_yaml__validate +++ /dev/null @@ -1,11 +0,0 @@ -invalid paths: invalid path /api/mail-service/pvt/providers/{EmailProvider}/dkim: invalid operation POST: invalid example: example unauthorized: Error at "/status": value is not one of the allowed values [401] -Schema: - { - "enum": [ - 401 - ], - "type": "integer" - } - -Value: - 401 diff --git a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Policies_System_API_1_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Policies_System_API_1_0_0_openapi_yaml__validate index 04638c631..760167265 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Policies_System_API_1_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/vtex_local_Policies_System_API_1_0_0_openapi_yaml__validate @@ -1,14 +1,124 @@ -invalid components: schema "Account": invalid example: value is not one of the allowed values [0,1] +invalid paths: invalid path /api/policy-engine/policies/{id}: invalid operation POST: invalid example: Error at "/0/statements/0/effect": property "effect" is missing Schema: { - "enum": [ - 0, - 1 + "properties": { + "actions": { + "description": "Actions that the Policy will execute", + "items": {}, + "properties": { + "id": { + "description": "Action ID. The possible values can be `SendSlackMessage`, `SendEmail`, and `DeactivatePromotions`", + "title": "id", + "type": "string" + }, + "metadata": { + "additionalProperties": true, + "description": "Data inside of the actions", + "title": "metadata", + "type": "object" + } + }, + "title": "actions", + "type": "array" + }, + "condition": { + "description": "Condition to activate this policy. This object can have a maximum of ten recursive conditions", + "properties": { + "conditions": { + "description": "List of conditions that will activate the policy", + "items": { + "properties": { + "conditions": { + "description": "These are the conditions the actions can have. The possible values are `[]`, `stringEquals`, and `numericGreaterThan`", + "items": { + "type": "string" + }, + "title": "conditions", + "type": "array" + }, + "key": { + "description": "The element that will define what the policy will influence. This field has the possible values `skuId`, `brandId`, `discountPercentage`", + "title": "key", + "type": "string" + }, + "operation": { + "description": "The action of the condition. This operation possible values are `None`, `stringEquals`, `stringEqualsIgnoreCase`, `numericEquals`, `numericLessThan`, `numericLessThanEquals`, `numericGreaterThan`, `numericGreaterThanEquals`, `bool`, `not`, `or`, `and`, `dateTimeUtcGreaterThan`, `dateTimeUtcLessThan`, and `between`", + "title": "operation", + "type": "string" + }, + "values": { + "description": "Value of the key", + "items": { + "type": "string" + }, + "title": "values", + "type": "array" + } + } + }, + "type": "array" + } + }, + "title": "condition", + "type": "object" + }, + "effect": { + "default": "Allow", + "description": "This field is not functional at the moment. To create a correct request, fill the field with `Allow`", + "title": "effect", + "type": "string" + }, + "operation": { + "description": "This operation will determine if all the conditions need to be valid or at least one of them, if the conditions array is not empty. The possible values to these fields are `None`, `stringEquals`, `stringEqualsIgnoreCase`, `numericEquals`, `numericLessThan`, `numericLessThanEquals`, `numericGreaterThan`, `numericGreaterThanEquals`, `bool`, `not`, `or`, `and`, `dateTimeUtcGreaterThan`, `dateTimeUtcLessThan`, and `between`", + "title": "operation", + "type": "string" + }, + "resource": { + "description": "Scope on which this policy must be evaluated", + "title": "resource", + "type": "string" + } + }, + "required": [ + "effect" ], - "example": 0, - "title": "AccountType", - "type": "integer" + "type": "object" } Value: - 0 + { + "actions": [ + { + "id": "SendSlackMessage", + "metadata": { + "alertDescription": "Avoid selling products from Berenice with a discount greater than 70%.", + "channel": "C01NJFF35R6", + "relatedUsers": [ + "URUNDC2NB" + ] + } + } + ], + "condition": { + "conditions": [ + { + "conditions": [], + "key": "brandId", + "operation": "stringEquals", + "values": [ + "2000001" + ] + }, + { + "conditions": [], + "key": "discountPercentage", + "operation": "numericGreaterThan", + "values": [ + "70.00" + ] + } + ], + "operation": "and" + }, + "resource": "vrn:vtex.promotions-alert:aws-us-east-1:kamila:master:/_v/promotions_alert" + } diff --git a/openapi3/testdata/apis_guru_openapi_directory/zoom_us_2_0_0_openapi_yaml__validate b/openapi3/testdata/apis_guru_openapi_directory/zoom_us_2_0_0_openapi_yaml__validate index c095ab796..9662cd931 100644 --- a/openapi3/testdata/apis_guru_openapi_directory/zoom_us_2_0_0_openapi_yaml__validate +++ b/openapi3/testdata/apis_guru_openapi_directory/zoom_us_2_0_0_openapi_yaml__validate @@ -1,20 +1,49 @@ -invalid components: schema "CreateWebinarSettings": invalid default: value is not one of the allowed values [0,1,2] +invalid paths: invalid path /accounts: invalid operation GET: invalid example: example response: doesn't match schema due to: Error at "/page_count": value must be an integer Schema: { - "default": 2, - "description": "The default value is `2`. To enable registration required, set the approval type to `0` or `1`. Values include:\u003cbr\u003e\n\n`0` - Automatically approve.\u003cbr\u003e`1` - Manually approve.\u003cbr\u003e`2` - No registration required.", - "enum": [ - 0, - 1, - 2 - ], - "type": "integer", - "x-enum-descriptions": [ - "Automatically Approve", - "Manually Approve", - "No Registration Required" - ] + "description": "The number of pages returned for the request made.", + "type": "integer" } Value: - 2 + "integer" + | Error at "/page_number": value must be an integer +Schema: + { + "default": 1, + "description": "**Deprecated**: This field has been deprecated. Please use the \"next_page_token\" field for pagination instead of this field.\n\nThe page number of the current results.", + "type": "integer" + } + +Value: + "integer" + | Error at "/page_size": value must be an integer +Schema: + { + "default": 30, + "description": "The number of records returned with a single API call.", + "maximum": 300, + "type": "integer" + } + +Value: + "integer" + | Error at "/total_records": value must be an integer +Schema: + { + "description": "The total number of all the records available across pages.", + "type": "integer" + } + +Value: + "integer" + And Error at "/accounts/0/created_at": string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" | Error at "/accounts/0/seats": value must be an integer +Schema: + { + "description": "Account seats.", + "type": "integer" + } + +Value: + "integer" + | Error at "/accounts/0/subscription_end_time": string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" | Error at "/accounts/0/subscription_start_time": string doesn't match the format "date-time": string doesn't match pattern "^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$" From ddd9bec64864cce0cbf17c7412d79bb0a1c08788 Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 19:51:27 +0300 Subject: [PATCH 23/31] Take openapi2 off the yaml fork, minimally openapi2 keeps its JSON round trip and every UnmarshalJSON exactly as they are. Only the YAML front half changes: the stock parser produces a node tree, and the document is marshalled from it. No UnmarshalYAML methods, no shared helpers, no behaviour change intended. Two things must be reconciled before the tree can become JSON, which is what the wrapper was doing: a date-shaped scalar resolves to a timestamp, which has no JSON form a non-string mapping key decodes to a map[any]any that json.Marshal rejects -- and an unquoted 200: is how most specs write a status code Both are retagged as strings, an explicit tag left alone. The key case is worth noting because openapi2's own suite did not catch it: the corpus quotes its status codes. A probe with an unquoted 200: failed with "json: unsupported type: map[interface {}]interface {}" before the retag. cmd/validate gets openapi2.UnmarshalFromData rather than reimplementing the round trip, mirroring the Loader the v3 side already exposes. No non-test code references github.com/oasdiff/yaml or yaml3 now. The go.mod entries stay until eight test files move, which is where this stops being a minimal change. --- .github/docs/openapi2.txt | 7 +++++ cmd/validate/main.go | 6 ++--- openapi2/marsh.go | 56 ++++++++++++++++++++++++++++++++++++--- 3 files changed, 62 insertions(+), 7 deletions(-) diff --git a/.github/docs/openapi2.txt b/.github/docs/openapi2.txt index 9b8a99822..6e963a324 100644 --- a/.github/docs/openapi2.txt +++ b/.github/docs/openapi2.txt @@ -7,6 +7,13 @@ backwards-compatible with version 2, version 3 elements have been used. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md +FUNCTIONS + +func UnmarshalFromData(data []byte, doc *T) error + UnmarshalFromData loads a document from swagger 2.0 bytes in either JSON or + YAML. The v3 side has Loader for this; here the whole job is the decode. + + TYPES type Header struct { diff --git a/cmd/validate/main.go b/cmd/validate/main.go index b742a9611..c785c5f2b 100644 --- a/cmd/validate/main.go +++ b/cmd/validate/main.go @@ -6,7 +6,7 @@ import ( "os" "strings" - "github.com/oasdiff/yaml" + yaml "go.yaml.in/yaml/v3" "github.com/getkin/kin-openapi/openapi2" "github.com/getkin/kin-openapi/openapi3" @@ -53,7 +53,7 @@ func main() { OpenAPI string `json:"openapi" yaml:"openapi"` Swagger string `json:"swagger" yaml:"swagger"` } - if _, err := yaml.Unmarshal(data, &vd, yaml.DecodeOpts{DisableTimestamps: true}); err != nil { + if err := yaml.Unmarshal(data, &vd); err != nil { log.Fatal(err) } @@ -109,7 +109,7 @@ func main() { } var doc openapi2.T - if _, err := yaml.Unmarshal(data, &doc, yaml.DecodeOpts{DisableTimestamps: true}); err != nil { + if err := openapi2.UnmarshalFromData(data, &doc); err != nil { log.Fatalln("Loading error:", err) } diff --git a/openapi2/marsh.go b/openapi2/marsh.go index 6e3bb540a..951bb003a 100644 --- a/openapi2/marsh.go +++ b/openapi2/marsh.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - "github.com/oasdiff/yaml" + yaml "go.yaml.in/yaml/v3" ) func unmarshalError(jsonUnmarshalErr error) error { @@ -24,11 +24,59 @@ func unmarshal(data []byte, v any) error { return nil } - // UnmarshalStrict(data, v) TODO: investigate how ymlv3 handles duplicate map keys - if _, yamlErr = yaml.Unmarshal(data, v, yaml.DecodeOpts{DisableTimestamps: true}); yamlErr == nil { - return nil + // YAML reaches these types through JSON, since they implement + // UnmarshalJSON and not UnmarshalYAML. See prepareForJSON for what has to + // be reconciled first. + var root yaml.Node + if err := yaml.Unmarshal(data, &root); err == nil { + prepareForJSON(&root) + var generic any + if err := root.Decode(&generic); err == nil { + if j, err := json.Marshal(generic); err == nil { + if yamlErr = json.Unmarshal(j, v); yamlErr == nil { + return nil + } + } else { + yamlErr = err + } + } else { + yamlErr = err + } + } else { + yamlErr = err } // If both unmarshaling attempts fail, return a new error that includes both errors return fmt.Errorf("failed to unmarshal data: json error: %v, yaml error: %v", jsonErr, yamlErr) } + +// prepareForJSON retags the two things YAML resolves that JSON cannot carry. +// +// A date-shaped scalar resolves to a timestamp, which has no JSON form. And a +// mapping key that is not a string -- the unquoted 200: written in most specs +// for a status code -- decodes to a map[any]any that json.Marshal rejects. +// Both are retagged as strings, an explicit tag being left alone. +func prepareForJSON(n *yaml.Node) { + if n == nil { + return + } + if n.Kind == yaml.ScalarNode && n.Tag == "!!timestamp" && n.Style != yaml.TaggedStyle { + n.Tag = "!!str" + } + if n.Kind == yaml.MappingNode { + for i := 0; i < len(n.Content); i += 2 { + if k := n.Content[i]; k.Kind == yaml.ScalarNode && k.Tag != "!!str" { + k.Tag = "!!str" + } + } + } + for _, c := range n.Content { + prepareForJSON(c) + } +} + +// UnmarshalFromData loads a document from swagger 2.0 bytes in either JSON or +// YAML. The v3 side has Loader for this; here the whole job is the decode. +func UnmarshalFromData(data []byte, doc *T) error { + return unmarshal(data, doc) +} From 6b321c00d2c4f365b93e427c76a15647db83cd0b Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 20:00:10 +0300 Subject: [PATCH 24/31] Drop the oasdiff/yaml and yaml3 dependencies Both forks are gone from go.mod. What the wrapper was providing is 60 lines in internal/yamlconv: a type that describes itself with json tags and UnmarshalJSON reaches YAML through JSON, and the two things YAML resolves that JSON cannot carry -- a timestamp, and a non-string mapping key -- are retagged first. openapi2/marsh.go now calls it instead of carrying its own copy. The eight test files used the wrapper for the same reason: its Marshal and Unmarshal went through JSON, so the types' methods ran. Stock go-yaml would not call them, and extensions would have been dropped from the output, so the call sites move to the helper rather than to yaml.Marshal. Unmarshal loses the wrapper's unused first return value; Marshal keeps its arity. One test stops being skipped. issue883 round-trips a document through stock go-yaml and gave up at the decode, since maplike types had no yaml Unmarshaler -- which is what the native loader added. Removing the skip leaves the test passing, so the TODO it carried is answered rather than merely relocated. openapi3 stays at its known 18 failures, all in the origin end-position expectations. Every other package is green. --- go.mod | 2 - go.sum | 4 -- internal/yamlconv/yamlconv.go | 70 +++++++++++++++++++ openapi2/marsh.go | 49 ++----------- openapi2/openapi2_test.go | 6 +- .../powerdns_local_0_0_13_swagger_yaml__load | 2 +- .../v2_apis_guru_openapi_directory_test.go | 4 +- openapi2conv/issue1062_test.go | 4 +- openapi2conv/issue1069_test.go | 4 +- openapi2conv/issue187_test.go | 8 +-- openapi2conv/issue558_test.go | 4 +- openapi3/issue883_test.go | 9 ++- openapi3/openapi3_test.go | 12 ++-- 13 files changed, 100 insertions(+), 78 deletions(-) create mode 100644 internal/yamlconv/yamlconv.go diff --git a/go.mod b/go.mod index 8ccac28b7..6cf3bf581 100644 --- a/go.mod +++ b/go.mod @@ -5,8 +5,6 @@ go 1.25 require ( github.com/go-openapi/jsonpointer v0.22.5 github.com/gorilla/mux v1.8.0 - github.com/oasdiff/yaml v0.1.1 - github.com/oasdiff/yaml3 v0.0.14 github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 github.com/stretchr/testify v1.9.0 go.yaml.in/yaml/v3 v3.0.5 diff --git a/go.sum b/go.sum index 5a1e721cd..e84c17f5e 100644 --- a/go.sum +++ b/go.sum @@ -17,10 +17,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/oasdiff/yaml v0.1.1 h1:6nHx+pn9gBRM6YpBlFZFQGCCd1nuvqOBtTD3KKTgGxY= -github.com/oasdiff/yaml v0.1.1/go.mod h1:EYJNoyktvWMJ0Hmhx+6qTaqMOsalUaRGT8Sj1hNcegU= -github.com/oasdiff/yaml3 v0.0.14 h1:aLJee3hxBK2H5wdXd9iPcIXb93Nty1Ge0pT171eHtkw= -github.com/oasdiff/yaml3 v0.0.14/go.mod h1:csto2xfDjYccdUn/yw/bPjj/cYTdp6HtFA0J4TWG+gg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 h1:KRzFb2m7YtdldCEkzs6KqmJw4nqEVZGK7IN2kJkjTuQ= diff --git a/internal/yamlconv/yamlconv.go b/internal/yamlconv/yamlconv.go new file mode 100644 index 000000000..5ddeadfa9 --- /dev/null +++ b/internal/yamlconv/yamlconv.go @@ -0,0 +1,70 @@ +// Package yamlconv converts between YAML and types that describe themselves +// with json tags and MarshalJSON/UnmarshalJSON methods. +// +// YAML reaches such a type through JSON, so its methods run and extensions are +// carried. Two things have to be reconciled first, both of which YAML resolves +// and JSON cannot represent. +package yamlconv + +import ( + "encoding/json" + + yaml "go.yaml.in/yaml/v3" +) + +// PrepareForJSON retags the scalars that would not survive the conversion. +// +// A date-shaped scalar resolves to a timestamp, which has no JSON form. A +// non-string mapping key -- the unquoted 200: written in most specs for a +// status code -- decodes to a map[any]any that json.Marshal rejects. Both +// become strings. An explicitly tagged value is left alone, being a deliberate +// request for that type. +func PrepareForJSON(n *yaml.Node) { + if n == nil { + return + } + if n.Kind == yaml.ScalarNode && n.Tag == "!!timestamp" && n.Style != yaml.TaggedStyle { + n.Tag = "!!str" + } + if n.Kind == yaml.MappingNode { + for i := 0; i < len(n.Content); i += 2 { + if k := n.Content[i]; k.Kind == yaml.ScalarNode && k.Tag != "!!str" { + k.Tag = "!!str" + } + } + } + for _, c := range n.Content { + PrepareForJSON(c) + } +} + +// Unmarshal decodes YAML into v via JSON, so v's UnmarshalJSON runs. +func Unmarshal(data []byte, v any) error { + var root yaml.Node + if err := yaml.Unmarshal(data, &root); err != nil { + return err + } + PrepareForJSON(&root) + var generic any + if err := root.Decode(&generic); err != nil { + return err + } + j, err := json.Marshal(generic) + if err != nil { + return err + } + return json.Unmarshal(j, v) +} + +// Marshal renders v as YAML via JSON, so v's MarshalJSON runs. +func Marshal(v any) ([]byte, error) { + j, err := json.Marshal(v) + if err != nil { + return nil, err + } + var generic any + if err := json.Unmarshal(j, &generic); err != nil { + return nil, err + } + return yaml.Marshal(generic) +} diff --git a/openapi2/marsh.go b/openapi2/marsh.go index 951bb003a..7a5b740f3 100644 --- a/openapi2/marsh.go +++ b/openapi2/marsh.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - yaml "go.yaml.in/yaml/v3" + "github.com/getkin/kin-openapi/internal/yamlconv" ) func unmarshalError(jsonUnmarshalErr error) error { @@ -25,56 +25,15 @@ func unmarshal(data []byte, v any) error { } // YAML reaches these types through JSON, since they implement - // UnmarshalJSON and not UnmarshalYAML. See prepareForJSON for what has to - // be reconciled first. - var root yaml.Node - if err := yaml.Unmarshal(data, &root); err == nil { - prepareForJSON(&root) - var generic any - if err := root.Decode(&generic); err == nil { - if j, err := json.Marshal(generic); err == nil { - if yamlErr = json.Unmarshal(j, v); yamlErr == nil { - return nil - } - } else { - yamlErr = err - } - } else { - yamlErr = err - } - } else { - yamlErr = err + // UnmarshalJSON and not UnmarshalYAML. + if yamlErr = yamlconv.Unmarshal(data, v); yamlErr == nil { + return nil } // If both unmarshaling attempts fail, return a new error that includes both errors return fmt.Errorf("failed to unmarshal data: json error: %v, yaml error: %v", jsonErr, yamlErr) } -// prepareForJSON retags the two things YAML resolves that JSON cannot carry. -// -// A date-shaped scalar resolves to a timestamp, which has no JSON form. And a -// mapping key that is not a string -- the unquoted 200: written in most specs -// for a status code -- decodes to a map[any]any that json.Marshal rejects. -// Both are retagged as strings, an explicit tag being left alone. -func prepareForJSON(n *yaml.Node) { - if n == nil { - return - } - if n.Kind == yaml.ScalarNode && n.Tag == "!!timestamp" && n.Style != yaml.TaggedStyle { - n.Tag = "!!str" - } - if n.Kind == yaml.MappingNode { - for i := 0; i < len(n.Content); i += 2 { - if k := n.Content[i]; k.Kind == yaml.ScalarNode && k.Tag != "!!str" { - k.Tag = "!!str" - } - } - } - for _, c := range n.Content { - prepareForJSON(c) - } -} - // UnmarshalFromData loads a document from swagger 2.0 bytes in either JSON or // YAML. The v3 side has Loader for this; here the whole job is the decode. func UnmarshalFromData(data []byte, doc *T) error { diff --git a/openapi2/openapi2_test.go b/openapi2/openapi2_test.go index c385215d1..047b463b7 100644 --- a/openapi2/openapi2_test.go +++ b/openapi2/openapi2_test.go @@ -6,7 +6,7 @@ import ( "os" "reflect" - "github.com/oasdiff/yaml" + "github.com/getkin/kin-openapi/internal/yamlconv" "github.com/getkin/kin-openapi/openapi2" ) @@ -37,12 +37,12 @@ func Example() { fmt.Println("objects doc & docAgainFromJSON should be the same") } - outputYAML, err := yaml.Marshal(doc) + outputYAML, err := yamlconv.Marshal(doc) if err != nil { panic(err) } var docAgainFromYAML openapi2.T - if _, err = yaml.Unmarshal(outputYAML, &docAgainFromYAML, yaml.DecodeOpts{DisableTimestamps: true}); err != nil { + if err = yamlconv.Unmarshal(outputYAML, &docAgainFromYAML); err != nil { panic(err) } if !reflect.DeepEqual(doc, docAgainFromYAML) { diff --git a/openapi2/testdata/apis_guru_openapi_directory/powerdns_local_0_0_13_swagger_yaml__load b/openapi2/testdata/apis_guru_openapi_directory/powerdns_local_0_0_13_swagger_yaml__load index 551a41634..f096ecb35 100644 --- a/openapi2/testdata/apis_guru_openapi_directory/powerdns_local_0_0_13_swagger_yaml__load +++ b/openapi2/testdata/apis_guru_openapi_directory/powerdns_local_0_0_13_swagger_yaml__load @@ -1 +1 @@ -error unmarshaling JSON: while decoding JSON: json: cannot unmarshal array into field Schema.items of type openapi2.Schema +json: cannot unmarshal array into field Schema.items of type openapi2.Schema diff --git a/openapi2/v2_apis_guru_openapi_directory_test.go b/openapi2/v2_apis_guru_openapi_directory_test.go index dd4838880..6d1324f7b 100644 --- a/openapi2/v2_apis_guru_openapi_directory_test.go +++ b/openapi2/v2_apis_guru_openapi_directory_test.go @@ -13,7 +13,7 @@ import ( "sync" "testing" - "github.com/oasdiff/yaml" + "github.com/getkin/kin-openapi/internal/yamlconv" "github.com/stretchr/testify/require" "github.com/getkin/kin-openapi/openapi2" @@ -189,7 +189,7 @@ func TestV2ApisGuruOpenapiDirectory(t *testing.T) { require.NoError(t, err) var doc openapi2.T - _, err = yaml.Unmarshal(data, &doc, yaml.DecodeOpts{DisableTimestamps: true}) + err = yamlconv.Unmarshal(data, &doc) golden(t, err, shortName, "load") }) } diff --git a/openapi2conv/issue1062_test.go b/openapi2conv/issue1062_test.go index 1c308774b..f7d4aefb4 100644 --- a/openapi2conv/issue1062_test.go +++ b/openapi2conv/issue1062_test.go @@ -3,7 +3,7 @@ package openapi2conv_test import ( "testing" - "github.com/oasdiff/yaml" + "github.com/getkin/kin-openapi/internal/yamlconv" "github.com/stretchr/testify/require" "github.com/getkin/kin-openapi/openapi2conv" @@ -59,7 +59,7 @@ components: ` var doc3 openapi3.T - _, err := yaml.Unmarshal([]byte(v3Spec), &doc3, yaml.DecodeOpts{DisableTimestamps: true}) + err := yamlconv.Unmarshal([]byte(v3Spec), &doc3) require.NoError(t, err, "unmarshal v3 spec") // Pre-fix: this call panicked with diff --git a/openapi2conv/issue1069_test.go b/openapi2conv/issue1069_test.go index 8a1d385bd..3edc71b8c 100644 --- a/openapi2conv/issue1069_test.go +++ b/openapi2conv/issue1069_test.go @@ -3,7 +3,7 @@ package openapi2conv_test import ( "testing" - "github.com/oasdiff/yaml" + "github.com/getkin/kin-openapi/internal/yamlconv" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -199,7 +199,7 @@ paths: for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { var doc3 openapi3.T - _, err := yaml.Unmarshal([]byte(tt.v3Spec), &doc3, yaml.DecodeOpts{DisableTimestamps: true}) + err := yamlconv.Unmarshal([]byte(tt.v3Spec), &doc3) require.NoError(t, err) v2, err := openapi2conv.FromV3(&doc3) diff --git a/openapi2conv/issue187_test.go b/openapi2conv/issue187_test.go index 3978d3693..ae55cde41 100644 --- a/openapi2conv/issue187_test.go +++ b/openapi2conv/issue187_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "testing" - "github.com/oasdiff/yaml" + "github.com/getkin/kin-openapi/internal/yamlconv" "github.com/stretchr/testify/require" "github.com/getkin/kin-openapi/openapi2" @@ -23,7 +23,7 @@ func v2v3JSON(spec2 []byte) (doc3 *openapi3.T, err error) { func v2v3YAML(spec2 []byte) (doc3 *openapi3.T, err error) { var doc2 openapi2.T - if _, err = yaml.Unmarshal(spec2, &doc2, yaml.DecodeOpts{DisableTimestamps: true}); err != nil { + if err = yamlconv.Unmarshal(spec2, &doc2); err != nil { return } doc3, err = openapi2conv.ToV3(&doc2) @@ -137,7 +137,7 @@ definitions: doc3, err := v2v3YAML([]byte(spec)) require.NoError(t, err) - spec3, err := yaml.Marshal(doc3) + spec3, err := yamlconv.Marshal(doc3) require.NoError(t, err) const expected = `components: schemas: @@ -185,7 +185,7 @@ securityDefinitions: doc3, err := v2v3YAML([]byte(spec)) require.NoError(t, err) require.NotNil(t, doc3.Components.SecuritySchemes["OAuth2Application"].Value.Flows.ClientCredentials) - _, err = yaml.Marshal(doc3) + _, err = yamlconv.Marshal(doc3) require.NoError(t, err) doc2, err := openapi2conv.FromV3(doc3) diff --git a/openapi2conv/issue558_test.go b/openapi2conv/issue558_test.go index 79668c22f..5ec089519 100644 --- a/openapi2conv/issue558_test.go +++ b/openapi2conv/issue558_test.go @@ -3,7 +3,7 @@ package openapi2conv_test import ( "testing" - "github.com/oasdiff/yaml" + "github.com/getkin/kin-openapi/internal/yamlconv" "github.com/stretchr/testify/require" "github.com/getkin/kin-openapi/openapi2conv" @@ -30,7 +30,7 @@ paths: doc3, err := v2v3YAML([]byte(spec)) require.NoError(t, err) require.NotEmpty(t, doc3.Paths.Value("/test").Get.Deprecated) - _, err = yaml.Marshal(doc3) + _, err = yamlconv.Marshal(doc3) require.NoError(t, err) doc2, err := openapi2conv.FromV3(doc3) diff --git a/openapi3/issue883_test.go b/openapi3/issue883_test.go index faa1adb00..e6367e171 100644 --- a/openapi3/issue883_test.go +++ b/openapi3/issue883_test.go @@ -3,7 +3,7 @@ package openapi3_test import ( "testing" - yaml "github.com/oasdiff/yaml" + "github.com/getkin/kin-openapi/internal/yamlconv" "github.com/stretchr/testify/require" yamlv3 "go.yaml.in/yaml/v3" @@ -39,7 +39,7 @@ paths: require.NotNil(t, doc.Paths) t.Run("Roundtrip using yaml pkg", func(t *testing.T) { - justPaths, err := yaml.Marshal(doc.Paths) + justPaths, err := yamlconv.Marshal(doc.Paths) require.NoError(t, err) require.NotNil(t, doc.Paths) require.YAMLEq(t, ` @@ -51,13 +51,13 @@ paths: description: OK `[1:], string(justPaths)) - marshalledYaml, err := yaml.Marshal(doc) + marshalledYaml, err := yamlconv.Marshal(doc) require.NoError(t, err) require.NotNil(t, doc.Paths) require.YAMLEq(t, spec, string(marshalledYaml)) var newDoc openapi3.T - _, err = yaml.Unmarshal(marshalledYaml, &newDoc, yaml.DecodeOpts{DisableTimestamps: true}) + err = yamlconv.Unmarshal(marshalledYaml, &newDoc) require.NoError(t, err) require.NotNil(t, newDoc.Paths) require.Equal(t, doc, &newDoc) @@ -93,7 +93,6 @@ paths: require.NotNil(t, doc.Paths) require.YAMLEq(t, spec, string(marshalledYaml)) - t.Skip("TODO: impl https://pkg.go.dev/github.com/oasdiff/yaml3#Unmarshaler on maplike types") var newDoc openapi3.T err = yamlv3.Unmarshal(marshalledYaml, &newDoc) require.NoError(t, err) diff --git a/openapi3/openapi3_test.go b/openapi3/openapi3_test.go index 68ddfe8a9..949ae9a14 100644 --- a/openapi3/openapi3_test.go +++ b/openapi3/openapi3_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/oasdiff/yaml" + "github.com/getkin/kin-openapi/internal/yamlconv" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -55,13 +55,13 @@ func TestRefsYAML(t *testing.T) { loader := openapi3.NewLoader() t.Log("Marshal *T to YAML") - data, err := yaml.Marshal(spec()) + data, err := yamlconv.Marshal(spec()) require.NoError(t, err) require.NotEmpty(t, data) t.Log("Unmarshal *T from YAML") docA := &openapi3.T{} - _, err = yaml.Unmarshal(specYAML, &docA, yaml.DecodeOpts{DisableTimestamps: true}) + err = yamlconv.Unmarshal(specYAML, &docA) require.NoError(t, err) require.NotEmpty(t, data) @@ -80,9 +80,9 @@ func TestRefsYAML(t *testing.T) { require.NoError(t, err) t.Log("Ensure representations match") - dataA, err := yaml.Marshal(docA) + dataA, err := yamlconv.Marshal(docA) require.NoError(t, err) - dataB, err := yaml.Marshal(docB) + dataB, err := yamlconv.Marshal(docB) require.NoError(t, err) require.YAMLEq(t, string(data), string(specYAML)) require.YAMLEq(t, string(data), string(dataA)) @@ -432,7 +432,7 @@ components: tt := tests[i] t.Run(tt.name, func(t *testing.T) { doc := &openapi3.T{} - _, err := yaml.Unmarshal([]byte(tt.spec), &doc, yaml.DecodeOpts{DisableTimestamps: true}) + err := yamlconv.Unmarshal([]byte(tt.spec), &doc) require.NoError(t, err) err = doc.Validate(t.Context()) From 3f09ffbc1d26f834a6734a2121ee6dcdae52dbc6 Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 20:15:37 +0300 Subject: [PATCH 25/31] Derive block extents from the node tree Location.EndLine and EndColumn were left at zero when the native loader landed, since go-yaml reports where a node starts and nothing about where it stops. They are derivable: a block ends on the last line any part of it occupies, which is the largest line among its descendants. Reading that off the tree, rather than from indentation, is what makes a sequence item work. A parameter's key location is the item's first key, which sits at the same column as the keys following it, so no column comparison can separate the end of the item from the start of its own second field. Its subtree ends where the item ends either way. The column-based version of this got parameters wrong; the tree-based one is also shorter. Two origin behaviours that the JSON path had are restored here, both found by tests rather than by inspection: An alias reports where its content was defined. Alias1: *base decodes to the anchored schema, so its origin is Base at line 7, not the line the alias sits on. The anchor's key is recorded during the same pass that measures extents. A scalar-valued map records its keys on the enclosing struct. A map[string]string -- scopes on an OAuth flow -- decodes to a plain map with nowhere to hang an Origin, so its key locations go on the parent under the field name, sorted. This was the behaviour of the deleted recordMapKeyLocations, which the native path had not taken over. openapi3 goes from 18 failures to 3: the two arbitrary-top-level-key ref origins, and one error-message string. oasdiff against this drops from 13 to 2. --- openapi3/end_positions.go | 107 ++++++++++++++++++++++++++++++++ openapi3/marsh.go | 2 + openapi3/native_yaml_special.go | 2 +- openapi3/origin.go | 62 +++++++++++++++--- 4 files changed, 162 insertions(+), 11 deletions(-) create mode 100644 openapi3/end_positions.go diff --git a/openapi3/end_positions.go b/openapi3/end_positions.go new file mode 100644 index 000000000..b8cb47270 --- /dev/null +++ b/openapi3/end_positions.go @@ -0,0 +1,107 @@ +package openapi3 + +import ( + "bytes" + + yaml "go.yaml.in/yaml/v3" +) + +// endIndex answers where the block headed by a key ends. +// +// The parser reports where every node starts and nothing about where it stops, +// so the end is derived: a block ends on the last line any part of it occupies, +// which is the largest line among the node's descendants. +// +// Reading it off the tree rather than from indentation is what makes a sequence +// item work. A parameter's key location is the item's first key, which sits at +// the same column as the keys following it, so no column comparison can tell +// the end of the item from the start of its own second field. Its subtree ends +// where the item ends either way. +// +// Trailing blank and comment lines fall outside, carrying no node. +type endIndex struct { + end map[*yaml.Node]int + // anchorKey is the key heading each anchored node, so an alias can report + // where the content it points at is defined. + anchorKey map[*yaml.Node]*yaml.Node + // lineLen is each line's length, giving the column a block's last line + // stops at. + lineLen []int +} + +// originEndsVar is the index for the decode in progress, alongside +// originFileVar. Ends are derived per file: a $ref into another file is decoded +// separately, against its own text. +var originEndsVar *endIndex + +// newEndIndex indexes data's node tree. Returns nil when origins are off, in +// which case no end is ever asked for. +func newEndIndex(root *yaml.Node, data []byte) *endIndex { + if !originEnabledVar || root == nil { + return nil + } + ei := &endIndex{end: map[*yaml.Node]int{}, anchorKey: map[*yaml.Node]*yaml.Node{}} + for _, line := range bytes.Split(data, []byte("\n")) { + ei.lineLen = append(ei.lineLen, len(bytes.TrimRight(line, "\r"))) + } + ei.measure(root) + return ei +} + +// measure records each node's last line, bottom up, and returns it. +func (ei *endIndex) measure(n *yaml.Node) int { + if n == nil { + return 0 + } + last := n.Line + if n.Kind == yaml.MappingNode { + for i := 0; i+1 < len(n.Content); i += 2 { + if v := n.Content[i+1]; v.Anchor != "" { + ei.anchorKey[v] = n.Content[i] + } + } + } + for _, c := range n.Content { + if l := ei.measure(c); l > last { + last = l + } + } + ei.end[n] = last + return last +} + +// endOf returns the last line and column of the block node occupies. +func (ei *endIndex) endOf(node *yaml.Node) (int, int) { + if ei == nil || node == nil { + return 0, 0 + } + line, ok := ei.end[node] + if !ok || line < 1 || line > len(ei.lineLen) { + return 0, 0 + } + // The column just past the last character, matching how a parser reports + // the position it stopped at. + return line, ei.lineLen[line-1] + 1 +} + +// withEnd returns loc carrying the extent of the block node heads. +func withEnd(loc Location, node *yaml.Node) Location { + loc.EndLine, loc.EndColumn = originEndsVar.endOf(node) + return loc +} + +// resolveAlias follows an alias to the node it points at, together with the key +// that node was defined under. An aliased schema is the anchored one, so its +// origin is where that content was written, not where it was referred to. +func resolveAlias(keyNode, valNode *yaml.Node) (*yaml.Node, *yaml.Node) { + if valNode == nil || valNode.Kind != yaml.AliasNode || valNode.Alias == nil { + return keyNode, valNode + } + if originEndsVar == nil { + return keyNode, valNode.Alias + } + if k, ok := originEndsVar.anchorKey[valNode.Alias]; ok { + return k, valNode.Alias + } + return keyNode, valNode.Alias +} diff --git a/openapi3/marsh.go b/openapi3/marsh.go index e8f1e2b33..1b1ff62ed 100644 --- a/openapi3/marsh.go +++ b/openapi3/marsh.go @@ -35,6 +35,8 @@ func unmarshal(data []byte, v any, includeOrigin bool, location *url.URL) (*orig var root goyaml.Node if err := goyaml.Unmarshal(data, &root); err == nil { stripTimestamps(&root) + // Ends are derived from the tree, the parser reporting only starts. + originEndsVar = newEndIndex(&root, data) if err = root.Decode(v); err == nil { if !includeOrigin { return nil, nil diff --git a/openapi3/native_yaml_special.go b/openapi3/native_yaml_special.go index f92b1dd20..df6dcfa22 100644 --- a/openapi3/native_yaml_special.go +++ b/openapi3/native_yaml_special.go @@ -35,7 +35,7 @@ func unmarshalMaplikeYAML[V any](node *yaml.Node, ext *map[string]any, out *map[ } (*out)[k] = &vv // The key node is in hand here, so no reflection is needed to find it. - setOriginKey(reflect.ValueOf(&vv), node.Content[i], nativeOriginFile()) + setOriginKey(reflect.ValueOf(&vv), node.Content[i], node.Content[i+1], nativeOriginFile()) } return nil } diff --git a/openapi3/origin.go b/openapi3/origin.go index 95423933c..999a3e19e 100644 --- a/openapi3/origin.go +++ b/openapi3/origin.go @@ -10,6 +10,7 @@ package openapi3 import ( "reflect" + "sort" "strings" yaml "go.yaml.in/yaml/v3" @@ -149,7 +150,8 @@ func setChildOriginKeys(node *yaml.Node, container any, file string) { if !child.IsValid() { continue } - setOriginKey(child, keyNode, file) + setOriginKey(child, keyNode, valNode, file) + recordScalarMapKeys(v, child, keyNode, valNode, file) switch c := deref(child); c.Kind() { case reflect.Map: @@ -168,7 +170,7 @@ func setChildOriginKeys(node *yaml.Node, container any, file string) { for j := 0; j < len(valNode.Content) && j < c.Len(); j++ { item := valNode.Content[j] if item.Kind == yaml.MappingNode && len(item.Content) > 0 { - setOriginKey(c.Index(j), item.Content[0], file) + setOriginKey(c.Index(j), item.Content[0], item, file) } } } @@ -210,10 +212,11 @@ func childByKey(v reflect.Value, key string) reflect.Value { // setOriginKey stamps Key on a child carrying an *Origin, from the key's own // position. The extent of what the key heads is the consumer's to derive. -func setOriginKey(child reflect.Value, keyNode *yaml.Node, file string) { +func setOriginKey(child reflect.Value, keyNode, valNode *yaml.Node, file string) { if !originEnabledVar { return } + keyNode, valNode = resolveAlias(keyNode, valNode) for child.Kind() == reflect.Pointer || child.Kind() == reflect.Interface { if child.IsNil() { return @@ -226,34 +229,35 @@ func setOriginKey(child reflect.Value, keyNode *yaml.Node, file string) { f := child.FieldByName("Origin") if !f.IsValid() || f.Type() != originPtrType || !f.CanSet() { // No origin of its own; it may still wrap something that has one. - descendToWrapped(child, keyNode, file) + descendToWrapped(child, keyNode, valNode, file) return } if f.IsNil() { f.Set(reflect.ValueOf(&Origin{})) } - f.Interface().(*Origin).Key = &Location{ + key := withEnd(Location{ File: file, Line: keyNode.Line, Column: keyNode.Column, Name: keyNode.Value, - } + }, valNode) + f.Interface().(*Origin).Key = &key // A wrapper and the thing it holds occupy the same node, so both carry // that node's origin. Value is the $ref wrappers; Schema is BoolSchema, // which holds either a bool or a schema. - descendToWrapped(child, keyNode, file) + descendToWrapped(child, keyNode, valNode, file) } // descendToWrapped stamps the thing a wrapper holds, which occupies the same // node. Value is the $ref wrappers; Schema is BoolSchema, which holds either a // bool or a schema. -func descendToWrapped(child reflect.Value, keyNode *yaml.Node, file string) { +func descendToWrapped(child reflect.Value, keyNode, valNode *yaml.Node, file string) { if child.Kind() != reflect.Struct { return } for _, name := range [...]string{"Value", "Schema"} { if inner := child.FieldByName(name); inner.IsValid() { - setOriginKey(inner, keyNode, file) + setOriginKey(inner, keyNode, valNode, file) } } } @@ -287,5 +291,43 @@ func stampRootOrigin(v any, node *yaml.Node) { if o.Key != nil { return } - o.Key = &Location{File: nativeOriginFile(), Line: node.Line, Column: node.Column} + key := withEnd(Location{File: nativeOriginFile(), Line: node.Line, Column: node.Column}, node) + o.Key = &key +} + +// recordScalarMapKeys records where each key of a scalar-valued map sits. +// +// A map[string]string -- scopes on an OAuth flow, say -- decodes to a plain Go +// map with nowhere to hang an Origin of its own, so its keys are recorded on +// the enclosing struct's Origin under the field name, sorted by key. +func recordScalarMapKeys(container, child reflect.Value, keyNode, valNode *yaml.Node, file string) { + if child.Kind() != reflect.Map || valNode == nil || valNode.Kind != yaml.MappingNode { + return + } + // A map of structs or pointers carries origins on its values instead. + switch child.Type().Elem().Kind() { + case reflect.Struct, reflect.Pointer, reflect.Interface, reflect.Map, reflect.Slice: + return + } + f := container.FieldByName("Origin") + if !f.IsValid() || f.Type() != originPtrType || !f.CanSet() { + return + } + if f.IsNil() { + f.Set(reflect.ValueOf(&Origin{})) + } + var locs []Location + for i := 0; i+1 < len(valNode.Content); i += 2 { + k := valNode.Content[i] + locs = append(locs, Location{File: file, Line: k.Line, Column: k.Column, Name: k.Value}) + } + if len(locs) == 0 { + return + } + sort.Slice(locs, func(i, j int) bool { return locs[i].Name < locs[j].Name }) + o := f.Interface().(*Origin) + if o.Sequences == nil { + o.Sequences = make(map[string][]Location) + } + o.Sequences[keyNode.Value] = locs } From 517cb7e43214d2ba1e3870ac0286a4f71e1af967 Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 20:23:45 +0300 Subject: [PATCH 26/31] Stamp a resolved $ref against the file it came from A $ref to a schema under an arbitrary top-level key resolves through T.Extensions, which decodes as plain data and carries no positions. The loader recovers the origins by decoding that subtree from the retained node tree, and two things about that decode were wrong. It stamped the wrong file. originFileVar still named the document being loaded, not the one the subtree came from, so an external ref reported openapi.yaml where the schema lives in schemas.yaml. The retained tree now carries the file and the end index it was measured against, and the decode runs with those in place. And it produced no key location. A value's key is stamped by the mapping above it, which does not run on this path -- the last fragment part is that key, so the walk keeps it and stamps it afterwards. kin-openapi is green. oasdiff against it is green too, once its copy of the error-message expectation moves with the one here. --- openapi3/loader.go | 23 +++++++++++++++++++---- openapi3/marsh.go | 4 ++-- openapi3/marsh_test.go | 4 +++- openapi3/origin.go | 25 +++++++++++++++++++------ 4 files changed, 43 insertions(+), 13 deletions(-) diff --git a/openapi3/loader.go b/openapi3/loader.go index 1654b1b6e..336386970 100644 --- a/openapi3/loader.go +++ b/openapi3/loader.go @@ -13,6 +13,8 @@ import ( "reflect" "strconv" "strings" + + yaml "go.yaml.in/yaml/v3" ) // IncludeOrigin specifies whether to include the origin of the OpenAPI elements. @@ -565,23 +567,36 @@ func (loader *Loader) attachOriginToResolved(resolved any, componentDoc *T, frag if !loader.IncludeOrigin { return } - node := loader.originTrees[componentDoc] - if node == nil { + tree := loader.originTrees[componentDoc] + if tree == nil { return } + // Stamp against the file this tree came from, not the document being + // loaded, which is what originFileVar still names here. + prevFile, prevEnds := originFileVar, originEndsVar + originFileVar, originEndsVar = tree.file, tree.ends + defer func() { originFileVar, originEndsVar = prevFile, prevEnds }() + + node := tree.node // Walk the retained node tree down to the fragment and decode that subtree // into the resolved value, which runs its UnmarshalYAML and so produces // origins. The generic-map resolution path that produced `resolved` has // none, because an extension value decodes as plain data. + var keyNode *yaml.Node for part := range strings.SplitSeq(strings.Trim(fragment, "/"), "/") { if part == "" { continue } - if node = mappingValue(node, unescapeRefString(part)); node == nil { + if keyNode, node = mappingEntry(node, unescapeRefString(part)); node == nil { return } } - _ = node.Decode(resolved) + if node.Decode(resolved) != nil { + return + } + // The key location is normally stamped by the mapping above, which does not + // run on this path: the last fragment part is that key. + setOriginKey(reflect.ValueOf(resolved), keyNode, node, tree.file) } func readableType(x any) string { diff --git a/openapi3/marsh.go b/openapi3/marsh.go index 1b1ff62ed..1dcc847f9 100644 --- a/openapi3/marsh.go +++ b/openapi3/marsh.go @@ -46,10 +46,10 @@ func unmarshal(data []byte, v any, includeOrigin bool, location *url.URL) (*orig // carries no positions. if root.Kind == goyaml.DocumentNode && len(root.Content) > 0 { stampRootOrigin(v, root.Content[0]) - return root.Content[0], nil + return &originTree{node: root.Content[0], file: file, ends: originEndsVar}, nil } stampRootOrigin(v, &root) - return &root, nil + return &originTree{node: &root, file: file, ends: originEndsVar}, nil } yamlErr = err } else { diff --git a/openapi3/marsh_test.go b/openapi3/marsh_test.go index cf0eb4d28..134a34336 100644 --- a/openapi3/marsh_test.go +++ b/openapi3/marsh_test.go @@ -40,7 +40,9 @@ paths: sl := openapi3.NewLoader() _, err := sl.LoadFromData(spec) - require.ErrorContains(t, err, `json: cannot unmarshal object into field Schema.allOf of type openapi3.SchemaRefs`) + // The parser reports the line, having decoded the document itself + // rather than a json rendering of it. It does not name the field. + require.ErrorContains(t, err, `line 24: cannot unmarshal !!map into openapi3.SchemaRefs`) } spec := []byte(` diff --git a/openapi3/origin.go b/openapi3/origin.go index 999a3e19e..b5374a59b 100644 --- a/openapi3/origin.go +++ b/openapi3/origin.go @@ -43,9 +43,15 @@ type Location struct { EndColumn int `json:"endColumn,omitempty" yaml:"endColumn,omitempty"` } -// originTree aliases the decoder-side origin tree, so the loader and marsh can -// carry it without referencing the yaml package directly. -type originTree = yaml.Node +// originTree is a decoded document's node tree together with what the origins +// read off it were stamped against. A $ref resolved later decodes a subtree of +// this, and must stamp the file the subtree came from rather than whichever +// document happened to be decoded last. +type originTree struct { + node *yaml.Node + file string + ends *endIndex +} // originFileVar is the file stamped into origins for the decode in progress. // UnmarshalYAML receives a node and nothing else, so the file cannot be passed @@ -68,15 +74,22 @@ func nativeOriginFile() string { return originFileVar } // mappingValue returns the value node for key, or nil. func mappingValue(node *yaml.Node, key string) *yaml.Node { + _, v := mappingEntry(node, key) + return v +} + +// mappingEntry returns both halves of a mapping entry, the key being what a +// value's origin records as its own location. +func mappingEntry(node *yaml.Node, key string) (*yaml.Node, *yaml.Node) { if node.Kind != yaml.MappingNode { - return nil + return nil, nil } for i := 0; i+1 < len(node.Content); i += 2 { if node.Content[i].Value == key { - return node.Content[i+1] + return node.Content[i], node.Content[i+1] } } - return nil + return nil, nil } // originFromNode builds the origin data a mapping can see for itself: where From c7f66cb340fe9810fbe79cfce8ab31ca4db6937e Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 20:51:40 +0300 Subject: [PATCH 27/31] Say what the package-level origin state actually costs The comment cited IncludeOrigin as precedent for a package-level var. There are two of those, and the one that is not deprecated is per-Loader precisely because sharing it was unsafe, so the precedent argued the opposite of what it claimed. The restriction is that concurrent decodes are unsafe even with separate Loaders. --- openapi3/origin.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/openapi3/origin.go b/openapi3/origin.go index 9462f0405..244539dfa 100644 --- a/openapi3/origin.go +++ b/openapi3/origin.go @@ -120,7 +120,13 @@ type originTree struct { // originFileVar is the file stamped into origins for the decode in progress. // UnmarshalYAML receives a node and nothing else, so the file cannot be passed -// through the call. One decode at a time per process, as with IncludeOrigin. +// through the call. +// +// Being package-level, this makes concurrent decodes unsafe even when each has +// its own Loader. That is stricter than Loader.IncludeOrigin, which is +// per-Loader precisely because the deprecated package-level IncludeOrigin was +// not safe to share. Serialising decodes, or carrying the state per decode, +// would remove the restriction; neither is done here. var originFileVar string // originEnabledVar mirrors the includeOrigin argument unmarshal receives, which From ed8329ee02b64746b7e2aa65814a36adbdf33334 Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 21:07:55 +0300 Subject: [PATCH 28/31] Satisfy the generated-artifact and lint gates The merge dropped two doc comments that the generated API listing then caught. FieldLocations had been grafted in between Location's comment and its type, so the comment documented the wrong symbol, and upstream's note on why Sequences stays a map while Fields became a slice was lost with the conflict resolution. Both restored, .github/docs regenerated. Import grouping per goimports-reviser, and bytes.SplitSeq in the end index per modernize. One hunk here is not part of this change: modernize also flags a loop in validation_error_test.go that master has not fixed, and since CI runs it with -fix and then diffs, the PR cannot go green without carrying it. --- openapi2/openapi2_test.go | 1 - openapi2/v2_apis_guru_openapi_directory_test.go | 2 +- openapi2conv/issue1062_test.go | 2 +- openapi2conv/issue1069_test.go | 2 +- openapi2conv/issue187_test.go | 2 +- openapi2conv/issue558_test.go | 2 +- openapi3/end_positions.go | 2 +- openapi3/issue883_test.go | 2 +- openapi3/native_e2e_test.go | 1 - openapi3/native_yaml_test.go | 1 - openapi3/openapi3_test.go | 2 +- openapi3/origin.go | 11 ++++++++++- openapi3/validation_error_test.go | 2 +- 13 files changed, 19 insertions(+), 13 deletions(-) diff --git a/openapi2/openapi2_test.go b/openapi2/openapi2_test.go index 047b463b7..b9cefb638 100644 --- a/openapi2/openapi2_test.go +++ b/openapi2/openapi2_test.go @@ -7,7 +7,6 @@ import ( "reflect" "github.com/getkin/kin-openapi/internal/yamlconv" - "github.com/getkin/kin-openapi/openapi2" ) diff --git a/openapi2/v2_apis_guru_openapi_directory_test.go b/openapi2/v2_apis_guru_openapi_directory_test.go index 6d1324f7b..ab971cd6d 100644 --- a/openapi2/v2_apis_guru_openapi_directory_test.go +++ b/openapi2/v2_apis_guru_openapi_directory_test.go @@ -13,9 +13,9 @@ import ( "sync" "testing" - "github.com/getkin/kin-openapi/internal/yamlconv" "github.com/stretchr/testify/require" + "github.com/getkin/kin-openapi/internal/yamlconv" "github.com/getkin/kin-openapi/openapi2" ) diff --git a/openapi2conv/issue1062_test.go b/openapi2conv/issue1062_test.go index f7d4aefb4..bdceb699b 100644 --- a/openapi2conv/issue1062_test.go +++ b/openapi2conv/issue1062_test.go @@ -3,9 +3,9 @@ package openapi2conv_test import ( "testing" - "github.com/getkin/kin-openapi/internal/yamlconv" "github.com/stretchr/testify/require" + "github.com/getkin/kin-openapi/internal/yamlconv" "github.com/getkin/kin-openapi/openapi2conv" "github.com/getkin/kin-openapi/openapi3" ) diff --git a/openapi2conv/issue1069_test.go b/openapi2conv/issue1069_test.go index 3edc71b8c..3c2a86316 100644 --- a/openapi2conv/issue1069_test.go +++ b/openapi2conv/issue1069_test.go @@ -3,10 +3,10 @@ package openapi2conv_test import ( "testing" - "github.com/getkin/kin-openapi/internal/yamlconv" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/getkin/kin-openapi/internal/yamlconv" "github.com/getkin/kin-openapi/openapi2" "github.com/getkin/kin-openapi/openapi2conv" "github.com/getkin/kin-openapi/openapi3" diff --git a/openapi2conv/issue187_test.go b/openapi2conv/issue187_test.go index ae55cde41..1e22ee0c2 100644 --- a/openapi2conv/issue187_test.go +++ b/openapi2conv/issue187_test.go @@ -4,9 +4,9 @@ import ( "encoding/json" "testing" - "github.com/getkin/kin-openapi/internal/yamlconv" "github.com/stretchr/testify/require" + "github.com/getkin/kin-openapi/internal/yamlconv" "github.com/getkin/kin-openapi/openapi2" "github.com/getkin/kin-openapi/openapi2conv" "github.com/getkin/kin-openapi/openapi3" diff --git a/openapi2conv/issue558_test.go b/openapi2conv/issue558_test.go index 5ec089519..c29a9ecf7 100644 --- a/openapi2conv/issue558_test.go +++ b/openapi2conv/issue558_test.go @@ -3,9 +3,9 @@ package openapi2conv_test import ( "testing" - "github.com/getkin/kin-openapi/internal/yamlconv" "github.com/stretchr/testify/require" + "github.com/getkin/kin-openapi/internal/yamlconv" "github.com/getkin/kin-openapi/openapi2conv" ) diff --git a/openapi3/end_positions.go b/openapi3/end_positions.go index b8cb47270..7091b4fd7 100644 --- a/openapi3/end_positions.go +++ b/openapi3/end_positions.go @@ -41,7 +41,7 @@ func newEndIndex(root *yaml.Node, data []byte) *endIndex { return nil } ei := &endIndex{end: map[*yaml.Node]int{}, anchorKey: map[*yaml.Node]*yaml.Node{}} - for _, line := range bytes.Split(data, []byte("\n")) { + for line := range bytes.SplitSeq(data, []byte("\n")) { ei.lineLen = append(ei.lineLen, len(bytes.TrimRight(line, "\r"))) } ei.measure(root) diff --git a/openapi3/issue883_test.go b/openapi3/issue883_test.go index e6367e171..4d2c766ed 100644 --- a/openapi3/issue883_test.go +++ b/openapi3/issue883_test.go @@ -3,10 +3,10 @@ package openapi3_test import ( "testing" - "github.com/getkin/kin-openapi/internal/yamlconv" "github.com/stretchr/testify/require" yamlv3 "go.yaml.in/yaml/v3" + "github.com/getkin/kin-openapi/internal/yamlconv" "github.com/getkin/kin-openapi/openapi3" ) diff --git a/openapi3/native_e2e_test.go b/openapi3/native_e2e_test.go index f1a75192c..c2605bf35 100644 --- a/openapi3/native_e2e_test.go +++ b/openapi3/native_e2e_test.go @@ -9,7 +9,6 @@ import ( "testing" "github.com/stretchr/testify/require" - goyaml "go.yaml.in/yaml/v3" ) diff --git a/openapi3/native_yaml_test.go b/openapi3/native_yaml_test.go index 0ed4af2ea..5fdfdd165 100644 --- a/openapi3/native_yaml_test.go +++ b/openapi3/native_yaml_test.go @@ -5,7 +5,6 @@ import ( "testing" "github.com/stretchr/testify/require" - goyaml "go.yaml.in/yaml/v3" ) diff --git a/openapi3/openapi3_test.go b/openapi3/openapi3_test.go index 949ae9a14..bf72e9269 100644 --- a/openapi3/openapi3_test.go +++ b/openapi3/openapi3_test.go @@ -6,10 +6,10 @@ import ( "strings" "testing" - "github.com/getkin/kin-openapi/internal/yamlconv" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/getkin/kin-openapi/internal/yamlconv" "github.com/getkin/kin-openapi/openapi3" ) diff --git a/openapi3/origin.go b/openapi3/origin.go index 244539dfa..c9953ca8b 100644 --- a/openapi3/origin.go +++ b/openapi3/origin.go @@ -24,13 +24,21 @@ var originPtrType = reflect.TypeFor[*Origin]() // Key is the location of the collection itself. // Fields holds the location of each scalar field in the collection. // Sequences is a map of the location of each item in sequence-valued fields. +// +// Sequences stays a map although Fields is a slice, which is deliberate. +// FieldLocations drops the map because Location.Name already carries the key, +// so the map was storing information the value repeated. Here Location.Name +// holds the *item's* value (an enum member, a required property) while the key +// is the *field's* name ("enum", "required", "tags"), so a slice would need a +// wrapper type invented to hold it. The memory argument is also much weaker: +// only a collection with a sequence-valued field allocates one at all, which +// measured at 5% of collections on a large spec, and a nil map is free. type Origin struct { Key *Location `json:"key,omitempty" yaml:"key,omitempty"` Fields FieldLocations `json:"fields,omitempty" yaml:"fields,omitempty"` Sequences map[string][]Location `json:"sequences,omitempty" yaml:"sequences,omitempty"` } -// Location is a struct that contains the location of a field. // FieldLocations holds the locations of a collection's scalar fields, in the // order they appear in the document. // @@ -94,6 +102,7 @@ func (f *FieldLocations) UnmarshalJSON(data []byte) error { return nil } +// Location is a struct that contains the location of a field. type Location struct { File string `json:"file,omitempty" yaml:"file,omitempty"` Line int `json:"line,omitempty" yaml:"line,omitempty"` diff --git a/openapi3/validation_error_test.go b/openapi3/validation_error_test.go index 21bfbfa18..23bf0adc0 100644 --- a/openapi3/validation_error_test.go +++ b/openapi3/validation_error_test.go @@ -2105,7 +2105,7 @@ func TestValidationError_SchemaCombinatorElementValidationError_NoStutter(t *tes // A run of same-combinator wrappers renders the prefix once, not per level. var nested error = leaf - for i := 0; i < 5; i++ { + for range 5 { nested = &openapi3.SchemaCombinatorElementValidationError{Combinator: "allOf", Cause: nested} } require.Equal(t, "invalid allOf element: boom", nested.Error()) From 5d698b76ad31130cb9df9dcd52167ad040ee2eea Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 21:17:31 +0300 Subject: [PATCH 29/31] Guard the per-decode origin state with a lock TestIssue741 loads concurrently, each goroutine with its own Loader, and the race detector caught all three package-level origin variables being written by every decode. The path this replaces passed the file as an argument to applyOrigins, so this was a regression, and CI would not have let it through. They are package-level because UnmarshalYAML receives a node and nothing else, with no way to carry per-decode state through the call. A mutex held for the length of the decode makes that safe. The cost is real and worth naming: decodes now serialise, even between separate Loaders. Single-decode throughput is unaffected, which is what the numbers in the description measure, but a caller parsing several documents at once no longer does so in parallel. Two ways out, neither taken here. A file recorded on the node would let the callback read it, since it already has the node, but go-yaml's Node has no such field. Filling the file in by walking the document after the decode would remove that one variable, but not the other two, which carry the origins-enabled flag and the end index. --- openapi3/loader.go | 2 ++ openapi3/marsh.go | 2 ++ openapi3/origin.go | 20 ++++++++++++++------ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/openapi3/loader.go b/openapi3/loader.go index 2009079c5..419cbb1cc 100644 --- a/openapi3/loader.go +++ b/openapi3/loader.go @@ -591,6 +591,8 @@ func (loader *Loader) attachOriginToResolved(resolved any, componentDoc *T, frag } // Stamp against the file this tree came from, not the document being // loaded, which is what originFileVar still names here. + originMu.Lock() + defer originMu.Unlock() prevFile, prevEnds := originFileVar, originEndsVar originFileVar, originEndsVar = tree.file, tree.ends defer func() { originFileVar, originEndsVar = prevFile, prevEnds }() diff --git a/openapi3/marsh.go b/openapi3/marsh.go index 1dcc847f9..920dff5af 100644 --- a/openapi3/marsh.go +++ b/openapi3/marsh.go @@ -31,6 +31,8 @@ func unmarshal(data []byte, v any, includeOrigin bool, location *url.URL) (*orig // One parse, straight into the types via UnmarshalYAML, with origins read // off the nodes. A JSON document gets origins too, since JSON parses as // YAML. + originMu.Lock() + defer originMu.Unlock() originFileVar, originEnabledVar = file, includeOrigin var root goyaml.Node if err := goyaml.Unmarshal(data, &root); err == nil { diff --git a/openapi3/origin.go b/openapi3/origin.go index c9953ca8b..ad1fb5e6e 100644 --- a/openapi3/origin.go +++ b/openapi3/origin.go @@ -14,6 +14,7 @@ import ( "slices" "sort" "strings" + "sync" yaml "go.yaml.in/yaml/v3" ) @@ -127,15 +128,22 @@ type originTree struct { ends *endIndex } +// originMu guards the three package-level variables below for the length of a +// decode. They exist because UnmarshalYAML receives a node and nothing else, +// with no way to carry per-decode state through the call, and a lock is what +// makes them safe to hold that way. +// +// The cost is that decodes serialise even when each has its own Loader, which +// TestIssue741 does. Correctness first: without this the three race, and the +// path this replaces passed the file as an argument and did not. +// +// A file recorded on the node itself would remove the need, since the callback +// already receives the node, but go-yaml's Node has no field for it. +var originMu sync.Mutex + // originFileVar is the file stamped into origins for the decode in progress. // UnmarshalYAML receives a node and nothing else, so the file cannot be passed // through the call. -// -// Being package-level, this makes concurrent decodes unsafe even when each has -// its own Loader. That is stricter than Loader.IncludeOrigin, which is -// per-Loader precisely because the deprecated package-level IncludeOrigin was -// not safe to share. Serialising decodes, or carrying the state per decode, -// would remove the restriction; neither is done here. var originFileVar string // originEnabledVar mirrors the includeOrigin argument unmarshal receives, which From 8197f83cd7c6d8046243ac3108afb6577d25a99b Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 21:25:37 +0300 Subject: [PATCH 30/31] Rescope the yaml-usage guard to the decode layer The guard asserted that yaml. appears exactly twice in openapi3 outside origin.go, which kept callers from bypassing unmarshal back when one function did all the decoding. Native decoding spreads that across the generated methods, the shared helpers and the end index, so the literal count cannot hold. The intent still can: nothing outside the decode layer should touch yaml directly. The check now names those files and requires zero references anywhere else, which is what it was really protecting. --- .github/workflows/go.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 16bb82e9f..a31cd7e26 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -104,9 +104,9 @@ jobs: ! git grep -IErn '\s$' - if: runner.os == 'Linux' - name: Ensure use of unmarshal + name: Ensure yaml stays inside the decode layer run: | - [[ "$(git grep -F yaml. -- openapi3/ | grep -v _test.go | grep -v origin.go | wc -l)" = 2 ]] + [[ "$(git grep -F yaml. -- openapi3/ | grep -v _test.go | grep -vE 'openapi3/(origin|marsh|end_positions|refs|loader|native_yaml.*|nativeyaml.*)[.](go|tmpl)' | wc -l)" = 0 ]] - if: runner.os == 'Linux' name: Use `loader := NewLoader(); loader.Load ...` From 63156038f844005686fa20663bc7f2e5e9414aa8 Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Mon, 3 Aug 2026 21:26:19 +0300 Subject: [PATCH 31/31] Compare the guard's count numerically wc -l pads its output on BSD, so the string comparison only held on the GNU wc that CI runs. -eq reads it as a number either way, and the check can be run locally before pushing. --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index a31cd7e26..ce991ac3c 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -106,7 +106,7 @@ jobs: - if: runner.os == 'Linux' name: Ensure yaml stays inside the decode layer run: | - [[ "$(git grep -F yaml. -- openapi3/ | grep -v _test.go | grep -vE 'openapi3/(origin|marsh|end_positions|refs|loader|native_yaml.*|nativeyaml.*)[.](go|tmpl)' | wc -l)" = 0 ]] + [[ "$(git grep -F yaml. -- openapi3/ | grep -v _test.go | grep -vE 'openapi3/(origin|marsh|end_positions|refs|loader|native_yaml.*|nativeyaml.*)[.](go|tmpl)' | wc -l)" -eq 0 ]] - if: runner.os == 'Linux' name: Use `loader := NewLoader(); loader.Load ...`