The resource type API need to increase the inspection
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Gnocchi |
Fix Released
|
Medium
|
fengchaoyang |
Bug Description
When I use resource type api to create a new resource type, I find if the attribute length_max less than length_min, max less than min, the resource type can also be created, such as:
POST /v1/resource_type HTTP/1.1
Content-Type: application/json
Content-Length: 360
{
"attributes": {
"display_name": {
"required": true,
"type": "string"
},
"enabled": {
"required": false,
"type": "bool"
},
"myid": {
"type": "uuid"
},
"prefix": {
"max_length": 3,
"min_length": 8,
"required": false,
"type": "string"
},
"size": {
"max": 32.8,
"min": 5,
"type": "number"
}
},
"name": "my_custom_type"
}
| ipmi | |
| my_custom_type | - enabled: required: False , type: bool |
| | - prefix: min_length: 8 , max_length: 3 , type: string , required: False |
| | - size: max: 5 , required: True , type: number , min: 32.5 |
| | - display_name: min_length: 0 , max_length: 255 , type: string , required: True |
| | - myid: required: True , type: uuid
So we need to check whether the min is less than or equal to Max
Changed in gnocchi: | |
status: | New → Confirmed |
assignee: | nobody → fengchaoyang (fengchaoyang) |
Changed in gnocchi: | |
importance: | Undecided → Medium |
Changed in gnocchi: | |
milestone: | none → 3.0.0 |
status: | Fix Committed → Fix Released |
Fix proposed to branch: master /review. openstack. org/361604
Review: https:/