From 3344f2e45779455bc3baac7553b21c5bb3f26204 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Wed, 22 Dec 2021 15:38:33 +0000 Subject: [PATCH] autogen(openapi): Regenerate swagger spec and internal client --- internal/httpclient/models/expand_tree.go | 14 +++++++++++++- .../models/get_relation_tuples_response.go | 4 ++++ .../httpclient/models/internal_relation_tuple.go | 4 ++++ internal/httpclient/models/patch_delta.go | 4 ++++ internal/httpclient/models/relation_query.go | 4 ++++ spec/api.json | 7 +++++-- 6 files changed, 34 insertions(+), 3 deletions(-) diff --git a/internal/httpclient/models/expand_tree.go b/internal/httpclient/models/expand_tree.go index 986d71d19..f76285ca1 100644 --- a/internal/httpclient/models/expand_tree.go +++ b/internal/httpclient/models/expand_tree.go @@ -30,7 +30,11 @@ type ExpandTree struct { // subject set SubjectSet *SubjectSet `json:"subject_set,omitempty"` - // type + // + // union Union + // exclusion Exclusion + // intersection Intersection + // leaf Leaf // Required: true // Enum: [union exclusion intersection leaf] Type *string `json:"type"` @@ -72,6 +76,8 @@ func (m *ExpandTree) validateChildren(formats strfmt.Registry) error { if err := m.Children[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("children" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("children" + "." + strconv.Itoa(i)) } return err } @@ -91,6 +97,8 @@ func (m *ExpandTree) validateSubjectSet(formats strfmt.Registry) error { if err := m.SubjectSet.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("subject_set") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("subject_set") } return err } @@ -174,6 +182,8 @@ func (m *ExpandTree) contextValidateChildren(ctx context.Context, formats strfmt if err := m.Children[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("children" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("children" + "." + strconv.Itoa(i)) } return err } @@ -190,6 +200,8 @@ func (m *ExpandTree) contextValidateSubjectSet(ctx context.Context, formats strf if err := m.SubjectSet.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("subject_set") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("subject_set") } return err } diff --git a/internal/httpclient/models/get_relation_tuples_response.go b/internal/httpclient/models/get_relation_tuples_response.go index e83f0dc18..e2e257e0d 100644 --- a/internal/httpclient/models/get_relation_tuples_response.go +++ b/internal/httpclient/models/get_relation_tuples_response.go @@ -56,6 +56,8 @@ func (m *GetRelationTuplesResponse) validateRelationTuples(formats strfmt.Regist if err := m.RelationTuples[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("relation_tuples" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("relation_tuples" + "." + strconv.Itoa(i)) } return err } @@ -88,6 +90,8 @@ func (m *GetRelationTuplesResponse) contextValidateRelationTuples(ctx context.Co if err := m.RelationTuples[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("relation_tuples" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("relation_tuples" + "." + strconv.Itoa(i)) } return err } diff --git a/internal/httpclient/models/internal_relation_tuple.go b/internal/httpclient/models/internal_relation_tuple.go index e17517c99..fc6445dbb 100644 --- a/internal/httpclient/models/internal_relation_tuple.go +++ b/internal/httpclient/models/internal_relation_tuple.go @@ -102,6 +102,8 @@ func (m *InternalRelationTuple) validateSubjectSet(formats strfmt.Registry) erro if err := m.SubjectSet.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("subject_set") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("subject_set") } return err } @@ -130,6 +132,8 @@ func (m *InternalRelationTuple) contextValidateSubjectSet(ctx context.Context, f if err := m.SubjectSet.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("subject_set") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("subject_set") } return err } diff --git a/internal/httpclient/models/patch_delta.go b/internal/httpclient/models/patch_delta.go index 2a02a7efb..e29ac7336 100644 --- a/internal/httpclient/models/patch_delta.go +++ b/internal/httpclient/models/patch_delta.go @@ -97,6 +97,8 @@ func (m *PatchDelta) validateRelationTuple(formats strfmt.Registry) error { if err := m.RelationTuple.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("relation_tuple") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("relation_tuple") } return err } @@ -125,6 +127,8 @@ func (m *PatchDelta) contextValidateRelationTuple(ctx context.Context, formats s if err := m.RelationTuple.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("relation_tuple") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("relation_tuple") } return err } diff --git a/internal/httpclient/models/relation_query.go b/internal/httpclient/models/relation_query.go index e07d68ce3..039caa854 100644 --- a/internal/httpclient/models/relation_query.go +++ b/internal/httpclient/models/relation_query.go @@ -74,6 +74,8 @@ func (m *RelationQuery) validateSubjectSet(formats strfmt.Registry) error { if err := m.SubjectSet.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("subject_set") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("subject_set") } return err } @@ -102,6 +104,8 @@ func (m *RelationQuery) contextValidateSubjectSet(ctx context.Context, formats s if err := m.SubjectSet.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("subject_set") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("subject_set") } return err } diff --git a/spec/api.json b/spec/api.json index ad501c121..28cecc9e8 100755 --- a/spec/api.json +++ b/spec/api.json @@ -1075,7 +1075,8 @@ "enum": [ "insert", "delete" - ] + ], + "x-go-enum-desc": "insert ActionInsert\ndelete ActionDelete" }, "relation_tuple": { "$ref": "#/definitions/InternalRelationTuple" @@ -1150,13 +1151,15 @@ "$ref": "#/definitions/SubjectSet" }, "type": { + "description": "\nunion Union\nexclusion Exclusion\nintersection Intersection\nleaf Leaf", "type": "string", "enum": [ "union", "exclusion", "intersection", "leaf" - ] + ], + "x-go-enum-desc": "union Union\nexclusion Exclusion\nintersection Intersection\nleaf Leaf" } } },