From 2dcae799dac5c34bfff07192b17240bd24cd2f18 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 5 Dec 2024 19:24:24 -0800 Subject: [PATCH] script always has a SubmissionID, it's just 0 --- openapi.yaml | 2 +- pkg/api/oas_json_gen.go | 14 +++++++------- pkg/api/oas_schemas_gen.go | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 860c295..0d0bef6 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -674,7 +674,7 @@ components: - ID - Hash - Source -# - SubmissionID + - SubmissionID type: object properties: ID: diff --git a/pkg/api/oas_json_gen.go b/pkg/api/oas_json_gen.go index b020d9d..12356f0 100644 --- a/pkg/api/oas_json_gen.go +++ b/pkg/api/oas_json_gen.go @@ -348,10 +348,8 @@ func (s *Script) encodeFields(e *jx.Encoder) { e.Str(s.Source) } { - if s.SubmissionID.Set { - e.FieldStart("SubmissionID") - s.SubmissionID.Encode(e) - } + e.FieldStart("SubmissionID") + e.Int64(s.SubmissionID) } } @@ -408,9 +406,11 @@ func (s *Script) Decode(d *jx.Decoder) error { return errors.Wrap(err, "decode field \"Source\"") } case "SubmissionID": + requiredBitSet[0] |= 1 << 3 if err := func() error { - s.SubmissionID.Reset() - if err := s.SubmissionID.Decode(d); err != nil { + v, err := d.Int64() + s.SubmissionID = int64(v) + if err != nil { return err } return nil @@ -427,7 +427,7 @@ func (s *Script) Decode(d *jx.Decoder) error { // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000111, + 0b00001111, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. diff --git a/pkg/api/oas_schemas_gen.go b/pkg/api/oas_schemas_gen.go index 17d2d0e..6e70618 100644 --- a/pkg/api/oas_schemas_gen.go +++ b/pkg/api/oas_schemas_gen.go @@ -340,10 +340,10 @@ type PatchSubmissionModelOK struct{} // Ref: #/components/schemas/Script type Script struct { - ID int64 `json:"ID"` - Hash string `json:"Hash"` - Source string `json:"Source"` - SubmissionID OptInt64 `json:"SubmissionID"` + ID int64 `json:"ID"` + Hash string `json:"Hash"` + Source string `json:"Source"` + SubmissionID int64 `json:"SubmissionID"` } // GetID returns the value of ID. @@ -362,7 +362,7 @@ func (s *Script) GetSource() string { } // GetSubmissionID returns the value of SubmissionID. -func (s *Script) GetSubmissionID() OptInt64 { +func (s *Script) GetSubmissionID() int64 { return s.SubmissionID } @@ -382,7 +382,7 @@ func (s *Script) SetSource(val string) { } // SetSubmissionID sets the value of SubmissionID. -func (s *Script) SetSubmissionID(val OptInt64) { +func (s *Script) SetSubmissionID(val int64) { s.SubmissionID = val }