Skip to content
Snippets Groups Projects
Commit 85075cd3 authored by Asra Ali's avatar Asra Ali
Browse files

Add max 32 mb on content data


Signed-off-by: default avatarAsra Ali <asraa@google.com>
parent cce6cabf
No related branches found
No related tags found
No related merge requests found
...@@ -175,6 +175,7 @@ func (m *RekordV001Schema) UnmarshalBinary(b []byte) error { ...@@ -175,6 +175,7 @@ func (m *RekordV001Schema) UnmarshalBinary(b []byte) error {
type RekordV001SchemaData struct { type RekordV001SchemaData struct {
// Specifies the content inline within the document // Specifies the content inline within the document
// Max Length: 32000000
// Format: byte // Format: byte
Content strfmt.Base64 `json:"content,omitempty"` Content strfmt.Base64 `json:"content,omitempty"`
...@@ -190,6 +191,10 @@ type RekordV001SchemaData struct { ...@@ -190,6 +191,10 @@ type RekordV001SchemaData struct {
func (m *RekordV001SchemaData) Validate(formats strfmt.Registry) error { func (m *RekordV001SchemaData) Validate(formats strfmt.Registry) error {
var res []error var res []error
if err := m.validateContent(formats); err != nil {
res = append(res, err)
}
if err := m.validateHash(formats); err != nil { if err := m.validateHash(formats); err != nil {
res = append(res, err) res = append(res, err)
} }
...@@ -204,6 +209,18 @@ func (m *RekordV001SchemaData) Validate(formats strfmt.Registry) error { ...@@ -204,6 +209,18 @@ func (m *RekordV001SchemaData) Validate(formats strfmt.Registry) error {
return nil return nil
} }
func (m *RekordV001SchemaData) validateContent(formats strfmt.Registry) error {
if swag.IsZero(m.Content) { // not required
return nil
}
if err := validate.MaxLength("data"+"."+"content", "body", m.Content.String(), 32000000); err != nil {
return err
}
return nil
}
func (m *RekordV001SchemaData) validateHash(formats strfmt.Registry) error { func (m *RekordV001SchemaData) validateHash(formats strfmt.Registry) error {
if swag.IsZero(m.Hash) { // not required if swag.IsZero(m.Hash) { // not required
return nil return nil
......
...@@ -175,6 +175,7 @@ func (m *RpmV001Schema) UnmarshalBinary(b []byte) error { ...@@ -175,6 +175,7 @@ func (m *RpmV001Schema) UnmarshalBinary(b []byte) error {
type RpmV001SchemaPackage struct { type RpmV001SchemaPackage struct {
// Specifies the package inline within the document // Specifies the package inline within the document
// Max Length: 32000000
// Format: byte // Format: byte
Content strfmt.Base64 `json:"content,omitempty"` Content strfmt.Base64 `json:"content,omitempty"`
...@@ -193,6 +194,10 @@ type RpmV001SchemaPackage struct { ...@@ -193,6 +194,10 @@ type RpmV001SchemaPackage struct {
func (m *RpmV001SchemaPackage) Validate(formats strfmt.Registry) error { func (m *RpmV001SchemaPackage) Validate(formats strfmt.Registry) error {
var res []error var res []error
if err := m.validateContent(formats); err != nil {
res = append(res, err)
}
if err := m.validateHash(formats); err != nil { if err := m.validateHash(formats); err != nil {
res = append(res, err) res = append(res, err)
} }
...@@ -207,6 +212,18 @@ func (m *RpmV001SchemaPackage) Validate(formats strfmt.Registry) error { ...@@ -207,6 +212,18 @@ func (m *RpmV001SchemaPackage) Validate(formats strfmt.Registry) error {
return nil return nil
} }
func (m *RpmV001SchemaPackage) validateContent(formats strfmt.Registry) error {
if swag.IsZero(m.Content) { // not required
return nil
}
if err := validate.MaxLength("package"+"."+"content", "body", m.Content.String(), 32000000); err != nil {
return err
}
return nil
}
func (m *RpmV001SchemaPackage) validateHash(formats strfmt.Registry) error { func (m *RpmV001SchemaPackage) validateHash(formats strfmt.Registry) error {
if swag.IsZero(m.Hash) { // not required if swag.IsZero(m.Hash) { // not required
return nil return nil
......
...@@ -1164,7 +1164,8 @@ func init() { ...@@ -1164,7 +1164,8 @@ func init() {
"content": { "content": {
"description": "Specifies the content inline within the document", "description": "Specifies the content inline within the document",
"type": "string", "type": "string",
"format": "byte" "format": "byte",
"maxLength": 32000000
}, },
"hash": { "hash": {
"description": "Specifies the hash algorithm and value for the content", "description": "Specifies the hash algorithm and value for the content",
...@@ -1332,7 +1333,8 @@ func init() { ...@@ -1332,7 +1333,8 @@ func init() {
"content": { "content": {
"description": "Specifies the package inline within the document", "description": "Specifies the package inline within the document",
"type": "string", "type": "string",
"format": "byte" "format": "byte",
"maxLength": 32000000
}, },
"hash": { "hash": {
"description": "Specifies the hash algorithm and value for the package", "description": "Specifies the hash algorithm and value for the package",
...@@ -1568,7 +1570,8 @@ func init() { ...@@ -1568,7 +1570,8 @@ func init() {
"content": { "content": {
"description": "Specifies the content inline within the document", "description": "Specifies the content inline within the document",
"type": "string", "type": "string",
"format": "byte" "format": "byte",
"maxLength": 32000000
}, },
"hash": { "hash": {
"description": "Specifies the hash algorithm and value for the content", "description": "Specifies the hash algorithm and value for the content",
...@@ -1747,7 +1750,8 @@ func init() { ...@@ -1747,7 +1750,8 @@ func init() {
"content": { "content": {
"description": "Specifies the package inline within the document", "description": "Specifies the package inline within the document",
"type": "string", "type": "string",
"format": "byte" "format": "byte",
"maxLength": 32000000
}, },
"hash": { "hash": {
"description": "Specifies the hash algorithm and value for the package", "description": "Specifies the hash algorithm and value for the package",
......
...@@ -86,7 +86,8 @@ ...@@ -86,7 +86,8 @@
"content": { "content": {
"description": "Specifies the content inline within the document", "description": "Specifies the content inline within the document",
"type": "string", "type": "string",
"format": "byte" "format": "byte",
"maxLength" : 32000000
} }
}, },
"oneOf": [ "oneOf": [
......
...@@ -64,7 +64,8 @@ ...@@ -64,7 +64,8 @@
"content": { "content": {
"description": "Specifies the package inline within the document", "description": "Specifies the package inline within the document",
"type": "string", "type": "string",
"format": "byte" "format": "byte",
"maxLength" : 32000000
} }
}, },
"oneOf": [ "oneOf": [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment