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 }