mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-31 02:28:09 +00:00 
			
		
		
		
	Make request objects required (#17909)
This commit is contained in:
		
							
								
								
									
										3
									
								
								changelog/17909.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								changelog/17909.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | ||||
| ```release-note:improvement | ||||
| openapi: Mark request body objects as required  | ||||
| ``` | ||||
| @@ -146,6 +146,7 @@ type OASParameter struct { | ||||
|  | ||||
| type OASRequestBody struct { | ||||
| 	Description string     `json:"description,omitempty"` | ||||
| 	Required    bool       `json:"required,omitempty"` | ||||
| 	Content     OASContent `json:"content,omitempty"` | ||||
| } | ||||
|  | ||||
| @@ -391,6 +392,7 @@ func documentPath(p *Path, specialPaths *logical.Paths, requestResponsePrefix st | ||||
| 					requestName := constructRequestName(requestResponsePrefix, path) | ||||
| 					doc.Components.Schemas[requestName] = s | ||||
| 					op.RequestBody = &OASRequestBody{ | ||||
| 						Required: true, | ||||
| 						Content: OASContent{ | ||||
| 							"application/json": &OASMediaTypeObject{ | ||||
| 								Schema: &OASSchema{Ref: fmt.Sprintf("#/components/schemas/%s", requestName)}, | ||||
|   | ||||
							
								
								
									
										1
									
								
								sdk/framework/testdata/legacy.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								sdk/framework/testdata/legacy.json
									
									
									
									
										vendored
									
									
								
							| @@ -38,6 +38,7 @@ | ||||
|         "summary": "Synopsis", | ||||
|         "tags": ["secrets"], | ||||
|         "requestBody": { | ||||
|           "required": true, | ||||
|           "content": { | ||||
|             "application/json": { | ||||
|               "schema": { | ||||
|   | ||||
							
								
								
									
										1
									
								
								sdk/framework/testdata/operations.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								sdk/framework/testdata/operations.json
									
									
									
									
										vendored
									
									
								
							| @@ -63,6 +63,7 @@ | ||||
|         "summary": "Update Summary", | ||||
|         "description": "Update Description", | ||||
|         "requestBody": { | ||||
|           "required": true, | ||||
|           "content": { | ||||
|             "application/json": { | ||||
|               "schema": { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 AnPucel
					AnPucel