mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 10:42:24 -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
				
			
		
							
								
								
									
										39
									
								
								vendor/github.com/go-openapi/analysis/flatten_name.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										39
									
								
								vendor/github.com/go-openapi/analysis/flatten_name.go
									
										
									
										generated
									
									
										vendored
									
									
								
							|  | @ -33,12 +33,14 @@ func (isn *InlineSchemaNamer) Name(key string, schema *spec.Schema, aschema *Ana | |||
| 		} | ||||
| 
 | ||||
| 		// create unique name | ||||
| 		newName, isOAIGen := uniqifyName(isn.Spec.Definitions, swag.ToJSONName(name)) | ||||
| 		mangle := mangler(isn.opts) | ||||
| 		newName, isOAIGen := uniqifyName(isn.Spec.Definitions, mangle(name)) | ||||
| 
 | ||||
| 		// clone schema | ||||
| 		sch := schutils.Clone(schema) | ||||
| 
 | ||||
| 		// replace values on schema | ||||
| 		debugLog("rewriting schema to ref: key=%s with new name: %s", key, newName) | ||||
| 		if err := replace.RewriteSchemaToRef(isn.Spec, key, | ||||
| 			spec.MustCreateRef(path.Join(definitionsPath, newName))); err != nil { | ||||
| 			return fmt.Errorf("error while creating definition %q from inline schema: %w", newName, err) | ||||
|  | @ -149,13 +151,15 @@ func namesFromKey(parts sortref.SplitKey, aschema *AnalyzedSchema, operations ma | |||
| 		startIndex int | ||||
| 	) | ||||
| 
 | ||||
| 	if parts.IsOperation() { | ||||
| 	switch { | ||||
| 	case parts.IsOperation(): | ||||
| 		baseNames, startIndex = namesForOperation(parts, operations) | ||||
| 	} | ||||
| 
 | ||||
| 	// definitions | ||||
| 	if parts.IsDefinition() { | ||||
| 	case parts.IsDefinition(): | ||||
| 		baseNames, startIndex = namesForDefinition(parts) | ||||
| 	default: | ||||
| 		// this a non-standard pointer: build a name by concatenating its parts | ||||
| 		baseNames = [][]string{parts} | ||||
| 		startIndex = len(baseNames) + 1 | ||||
| 	} | ||||
| 
 | ||||
| 	result := make([]string, 0, len(baseNames)) | ||||
|  | @ -169,6 +173,7 @@ func namesFromKey(parts sortref.SplitKey, aschema *AnalyzedSchema, operations ma | |||
| 	} | ||||
| 	sort.Strings(result) | ||||
| 
 | ||||
| 	debugLog("names from parts: %v => %v", parts, result) | ||||
| 	return result | ||||
| } | ||||
| 
 | ||||
|  | @ -256,10 +261,20 @@ func partAdder(aschema *AnalyzedSchema) sortref.PartAdder { | |||
| 	} | ||||
| } | ||||
| 
 | ||||
| func nameFromRef(ref spec.Ref) string { | ||||
| func mangler(o *FlattenOpts) func(string) string { | ||||
| 	if o.KeepNames { | ||||
| 		return func(in string) string { return in } | ||||
| 	} | ||||
| 
 | ||||
| 	return swag.ToJSONName | ||||
| } | ||||
| 
 | ||||
| func nameFromRef(ref spec.Ref, o *FlattenOpts) string { | ||||
| 	mangle := mangler(o) | ||||
| 
 | ||||
| 	u := ref.GetURL() | ||||
| 	if u.Fragment != "" { | ||||
| 		return swag.ToJSONName(path.Base(u.Fragment)) | ||||
| 		return mangle(path.Base(u.Fragment)) | ||||
| 	} | ||||
| 
 | ||||
| 	if u.Path != "" { | ||||
|  | @ -267,19 +282,19 @@ func nameFromRef(ref spec.Ref) string { | |||
| 		if bn != "" && bn != "/" { | ||||
| 			ext := path.Ext(bn) | ||||
| 			if ext != "" { | ||||
| 				return swag.ToJSONName(bn[:len(bn)-len(ext)]) | ||||
| 				return mangle(bn[:len(bn)-len(ext)]) | ||||
| 			} | ||||
| 
 | ||||
| 			return swag.ToJSONName(bn) | ||||
| 			return mangle(bn) | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	return swag.ToJSONName(strings.ReplaceAll(u.Host, ".", " ")) | ||||
| 	return mangle(strings.ReplaceAll(u.Host, ".", " ")) | ||||
| } | ||||
| 
 | ||||
| // GenLocation indicates from which section of the specification (models or operations) a definition has been created. | ||||
| // | ||||
| // This is reflected in the output spec with a "x-go-gen-location" extension. At the moment, this is is provided | ||||
| // This is reflected in the output spec with a "x-go-gen-location" extension. At the moment, this is provided | ||||
| // for information only. | ||||
| func GenLocation(parts sortref.SplitKey) string { | ||||
| 	switch { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue