mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Strip go2idl instructions from generated swagger doc
Ignore doc lines starting with +
This commit is contained in:
		@@ -65,11 +65,14 @@ func fmtRawDoc(rawDoc string) string {
 | 
			
		||||
 | 
			
		||||
	for _, line := range strings.Split(rawDoc, "\n") {
 | 
			
		||||
		line = strings.TrimRight(line, " ")
 | 
			
		||||
 | 
			
		||||
		if line == "" { // Keep paragraphs
 | 
			
		||||
		leading := strings.TrimLeft(line, " ")
 | 
			
		||||
		switch {
 | 
			
		||||
		case len(line) == 0: // Keep paragraphs
 | 
			
		||||
			delPrevChar()
 | 
			
		||||
			buffer.WriteString("\n\n")
 | 
			
		||||
		} else if !strings.HasPrefix(strings.TrimLeft(line, " "), "TODO") { // Ignore one line TODOs
 | 
			
		||||
		case strings.HasPrefix(leading, "TODO"): // Ignore one line TODOs
 | 
			
		||||
		case strings.HasPrefix(leading, "+"): // Ignore instructions to go2idl
 | 
			
		||||
		default:
 | 
			
		||||
			if strings.HasPrefix(line, " ") || strings.HasPrefix(line, "\t") {
 | 
			
		||||
				delPrevChar()
 | 
			
		||||
				line = "\n" + line + "\n" // Replace it with newline. This is useful when we have a line with: "Example:\n\tJSON-someting..."
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user