Update dependencies (#5518)

This commit is contained in:
hongming
2023-02-12 23:09:20 +08:00
committed by GitHub
parent d3b35fb2da
commit a979342f56
1486 changed files with 126660 additions and 71128 deletions

View File

@@ -32,7 +32,6 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
@@ -220,7 +219,7 @@ func (l *jsonReferenceLoader) loadFromHTTP(address string) (interface{}, error)
return nil, errors.New(formatErrorDescription(Locale.HTTPBadStatus(), ErrorDetails{"status": resp.Status}))
}
bodyBuff, err := ioutil.ReadAll(resp.Body)
bodyBuff, err := io.ReadAll(resp.Body)
if err != nil {
return nil, err
}
@@ -235,7 +234,7 @@ func (l *jsonReferenceLoader) loadFromFile(path string) (interface{}, error) {
}
defer f.Close()
bodyBuff, err := ioutil.ReadAll(f)
bodyBuff, err := io.ReadAll(f)
if err != nil {
return nil, err
}

View File

@@ -73,7 +73,6 @@ func (d *Schema) SetRootSchemaName(name string) {
// Pretty long function ( sorry :) )... but pretty straight forward, repetitive and boring
// Not much magic involved here, most of the job is to validate the key names and their values,
// then the values are copied into SubSchema struct
//
func (d *Schema) parseSchema(documentNode interface{}, currentSchema *SubSchema) error {
if currentSchema.Draft == nil {

View File

@@ -119,7 +119,7 @@ func (sl *SchemaLoader) AddSchemas(loaders ...JSONLoader) error {
return nil
}
//AddSchema adds a schema under the provided URL to the schema cache
// AddSchema adds a schema under the provided URL to the schema cache
func (sl *SchemaLoader) AddSchema(url string, loader JSONLoader) error {
ref, err := gojsonreference.NewJsonReference(url)

View File

@@ -503,7 +503,7 @@ func (v *SubSchema) validateArray(currentSubSchema *SubSchema, value []interface
// minItems & maxItems
if currentSubSchema.minItems != nil {
if nbValues < int(*currentSubSchema.minItems) {
if nbValues < *currentSubSchema.minItems {
result.addInternalError(
new(ArrayMinItemsError),
context,
@@ -513,7 +513,7 @@ func (v *SubSchema) validateArray(currentSubSchema *SubSchema, value []interface
}
}
if currentSubSchema.maxItems != nil {
if nbValues > int(*currentSubSchema.maxItems) {
if nbValues > *currentSubSchema.maxItems {
result.addInternalError(
new(ArrayMaxItemsError),
context,
@@ -587,7 +587,7 @@ func (v *SubSchema) validateObject(currentSubSchema *SubSchema, value map[string
// minProperties & maxProperties:
if currentSubSchema.minProperties != nil {
if len(value) < int(*currentSubSchema.minProperties) {
if len(value) < *currentSubSchema.minProperties {
result.addInternalError(
new(ArrayMinPropertiesError),
context,
@@ -597,7 +597,7 @@ func (v *SubSchema) validateObject(currentSubSchema *SubSchema, value map[string
}
}
if currentSubSchema.maxProperties != nil {
if len(value) > int(*currentSubSchema.maxProperties) {
if len(value) > *currentSubSchema.maxProperties {
result.addInternalError(
new(ArrayMaxPropertiesError),
context,
@@ -716,7 +716,7 @@ func (v *SubSchema) validateString(currentSubSchema *SubSchema, value interface{
// minLength & maxLength:
if currentSubSchema.minLength != nil {
if utf8.RuneCount([]byte(stringValue)) < int(*currentSubSchema.minLength) {
if utf8.RuneCount([]byte(stringValue)) < *currentSubSchema.minLength {
result.addInternalError(
new(StringLengthGTEError),
context,
@@ -726,7 +726,7 @@ func (v *SubSchema) validateString(currentSubSchema *SubSchema, value interface{
}
}
if currentSubSchema.maxLength != nil {
if utf8.RuneCount([]byte(stringValue)) > int(*currentSubSchema.maxLength) {
if utf8.RuneCount([]byte(stringValue)) > *currentSubSchema.maxLength {
result.addInternalError(
new(StringLengthLTEError),
context,