mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 13:12:25 -05:00 
			
		
		
		
	[chore] Bump go swagger (#2871)
* bump go swagger version * bump swagger version
This commit is contained in:
		
					parent
					
						
							
								3a369d834a
							
						
					
				
			
			
				commit
				
					
						fd8a724e77
					
				
			
		
					 251 changed files with 10841 additions and 11896 deletions
				
			
		
							
								
								
									
										31
									
								
								vendor/github.com/go-openapi/validate/schema_option.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										31
									
								
								vendor/github.com/go-openapi/validate/schema_option.go
									
										
									
										generated
									
									
										vendored
									
									
								
							|  | @ -18,6 +18,9 @@ package validate | |||
| type SchemaValidatorOptions struct { | ||||
| 	EnableObjectArrayTypeCheck    bool | ||||
| 	EnableArrayMustHaveItemsCheck bool | ||||
| 	recycleValidators             bool | ||||
| 	recycleResult                 bool | ||||
| 	skipSchemataResult            bool | ||||
| } | ||||
| 
 | ||||
| // Option sets optional rules for schema validation | ||||
|  | @ -45,10 +48,36 @@ func SwaggerSchema(enable bool) Option { | |||
| 	} | ||||
| } | ||||
| 
 | ||||
| // Options returns current options | ||||
| // WithRecycleValidators saves memory allocations and makes validators | ||||
| // available for a single use of Validate() only. | ||||
| // | ||||
| // When a validator is recycled, called MUST not call the Validate() method twice. | ||||
| func WithRecycleValidators(enable bool) Option { | ||||
| 	return func(svo *SchemaValidatorOptions) { | ||||
| 		svo.recycleValidators = enable | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| func withRecycleResults(enable bool) Option { | ||||
| 	return func(svo *SchemaValidatorOptions) { | ||||
| 		svo.recycleResult = enable | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| // WithSkipSchemataResult skips the deep audit payload stored in validation Result | ||||
| func WithSkipSchemataResult(enable bool) Option { | ||||
| 	return func(svo *SchemaValidatorOptions) { | ||||
| 		svo.skipSchemataResult = enable | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| // Options returns the current set of options | ||||
| func (svo SchemaValidatorOptions) Options() []Option { | ||||
| 	return []Option{ | ||||
| 		EnableObjectArrayTypeCheck(svo.EnableObjectArrayTypeCheck), | ||||
| 		EnableArrayMustHaveItemsCheck(svo.EnableArrayMustHaveItemsCheck), | ||||
| 		WithRecycleValidators(svo.recycleValidators), | ||||
| 		withRecycleResults(svo.recycleResult), | ||||
| 		WithSkipSchemataResult(svo.skipSchemataResult), | ||||
| 	} | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue