openapi: remove redundant SubmissionType

This commit is contained in:
Quaternions 2024-12-09 20:45:24 -08:00
parent 576c3a187a
commit 1c0ed6574f
3 changed files with 10 additions and 42 deletions

View File

@ -643,7 +643,6 @@ components:
- Submitter - Submitter
- AssetID - AssetID
- AssetVersion - AssetVersion
- SubmissionType
# - TargetAssetID # - TargetAssetID
type: object type: object
properties: properties:
@ -663,9 +662,6 @@ components:
AssetVersion: AssetVersion:
type: integer type: integer
format: int64 format: int64
SubmissionType:
type: integer
format: int32
TargetAssetID: TargetAssetID:
type: integer type: integer
format: int64 format: int64

View File

@ -1457,10 +1457,6 @@ func (s *SubmissionCreate) encodeFields(e *jx.Encoder) {
e.FieldStart("AssetVersion") e.FieldStart("AssetVersion")
e.Int64(s.AssetVersion) e.Int64(s.AssetVersion)
} }
{
e.FieldStart("SubmissionType")
e.Int32(s.SubmissionType)
}
{ {
if s.TargetAssetID.Set { if s.TargetAssetID.Set {
e.FieldStart("TargetAssetID") e.FieldStart("TargetAssetID")
@ -1469,15 +1465,14 @@ func (s *SubmissionCreate) encodeFields(e *jx.Encoder) {
} }
} }
var jsonFieldsNameOfSubmissionCreate = [8]string{ var jsonFieldsNameOfSubmissionCreate = [7]string{
0: "DisplayName", 0: "DisplayName",
1: "Creator", 1: "Creator",
2: "GameID", 2: "GameID",
3: "Submitter", 3: "Submitter",
4: "AssetID", 4: "AssetID",
5: "AssetVersion", 5: "AssetVersion",
6: "SubmissionType", 6: "TargetAssetID",
7: "TargetAssetID",
} }
// Decode decodes SubmissionCreate from json. // Decode decodes SubmissionCreate from json.
@ -1561,18 +1556,6 @@ func (s *SubmissionCreate) Decode(d *jx.Decoder) error {
}(); err != nil { }(); err != nil {
return errors.Wrap(err, "decode field \"AssetVersion\"") return errors.Wrap(err, "decode field \"AssetVersion\"")
} }
case "SubmissionType":
requiredBitSet[0] |= 1 << 6
if err := func() error {
v, err := d.Int32()
s.SubmissionType = int32(v)
if err != nil {
return err
}
return nil
}(); err != nil {
return errors.Wrap(err, "decode field \"SubmissionType\"")
}
case "TargetAssetID": case "TargetAssetID":
if err := func() error { if err := func() error {
s.TargetAssetID.Reset() s.TargetAssetID.Reset()
@ -1593,7 +1576,7 @@ func (s *SubmissionCreate) Decode(d *jx.Decoder) error {
// Validate required fields. // Validate required fields.
var failures []validate.FieldError var failures []validate.FieldError
for i, mask := range [1]uint8{ for i, mask := range [1]uint8{
0b01111111, 0b00111111,
} { } {
if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
// Mask only required fields and check equality to mask using XOR. // Mask only required fields and check equality to mask using XOR.

View File

@ -720,14 +720,13 @@ func (s *Submission) SetStatusID(val int32) {
// Ref: #/components/schemas/SubmissionCreate // Ref: #/components/schemas/SubmissionCreate
type SubmissionCreate struct { type SubmissionCreate struct {
DisplayName string `json:"DisplayName"` DisplayName string `json:"DisplayName"`
Creator string `json:"Creator"` Creator string `json:"Creator"`
GameID int32 `json:"GameID"` GameID int32 `json:"GameID"`
Submitter int64 `json:"Submitter"` Submitter int64 `json:"Submitter"`
AssetID int64 `json:"AssetID"` AssetID int64 `json:"AssetID"`
AssetVersion int64 `json:"AssetVersion"` AssetVersion int64 `json:"AssetVersion"`
SubmissionType int32 `json:"SubmissionType"` TargetAssetID OptInt64 `json:"TargetAssetID"`
TargetAssetID OptInt64 `json:"TargetAssetID"`
} }
// GetDisplayName returns the value of DisplayName. // GetDisplayName returns the value of DisplayName.
@ -760,11 +759,6 @@ func (s *SubmissionCreate) GetAssetVersion() int64 {
return s.AssetVersion return s.AssetVersion
} }
// GetSubmissionType returns the value of SubmissionType.
func (s *SubmissionCreate) GetSubmissionType() int32 {
return s.SubmissionType
}
// GetTargetAssetID returns the value of TargetAssetID. // GetTargetAssetID returns the value of TargetAssetID.
func (s *SubmissionCreate) GetTargetAssetID() OptInt64 { func (s *SubmissionCreate) GetTargetAssetID() OptInt64 {
return s.TargetAssetID return s.TargetAssetID
@ -800,11 +794,6 @@ func (s *SubmissionCreate) SetAssetVersion(val int64) {
s.AssetVersion = val s.AssetVersion = val
} }
// SetSubmissionType sets the value of SubmissionType.
func (s *SubmissionCreate) SetSubmissionType(val int32) {
s.SubmissionType = val
}
// SetTargetAssetID sets the value of TargetAssetID. // SetTargetAssetID sets the value of TargetAssetID.
func (s *SubmissionCreate) SetTargetAssetID(val OptInt64) { func (s *SubmissionCreate) SetTargetAssetID(val OptInt64) {
s.TargetAssetID = val s.TargetAssetID = val