)]}'
{"specs/ocata/approved/consistent-query-parameters-validation.rst":[{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"0a625980706198ae3b4fee5d879ce9465a619cf2","unresolved":false,"context_lines":[{"line_number":67,"context_line":"* `name` accepts a regex string. It only can be specified one times."},{"line_number":68,"context_line":"* `sort_key` can accept a string, the valid string are `created_at` and"},{"line_number":69,"context_line":"  `updated_at`. It can be specified multiple times."},{"line_number":70,"context_line":"* `deleted` is boolean value and only can be specified one times."},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"The request as below::"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"fa6399be_60691bf9","line":70,"updated":"2016-10-20 12:33:25.000000000","message":"there are some admin related query param can accept almost all input as query param, e.g server list, should we define all those with copy/pasting ?\n\nand we will create 2 schema for both admin and non-admin?","commit_id":"1fce336b5d86cdc119bb3347b61beced8646edbd"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"973d9122ddf83ba9f59e465926d504dc0a4f7565","unresolved":false,"context_lines":[{"line_number":67,"context_line":"* `name` accepts a regex string. It only can be specified one times."},{"line_number":68,"context_line":"* `sort_key` can accept a string, the valid string are `created_at` and"},{"line_number":69,"context_line":"  `updated_at`. It can be specified multiple times."},{"line_number":70,"context_line":"* `deleted` is boolean value and only can be specified one times."},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"The request as below::"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"da6895a0_e0957d40","line":70,"in_reply_to":"da6895a0_52045114","updated":"2016-10-23 03:42:38.000000000","message":"yes, I think so. We need explicitly show which query params supported.","commit_id":"1fce336b5d86cdc119bb3347b61beced8646edbd"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"e3cf400eeeaedb861127e41f68c618752ff5a337","unresolved":false,"context_lines":[{"line_number":67,"context_line":"* `name` accepts a regex string. It only can be specified one times."},{"line_number":68,"context_line":"* `sort_key` can accept a string, the valid string are `created_at` and"},{"line_number":69,"context_line":"  `updated_at`. It can be specified multiple times."},{"line_number":70,"context_line":"* `deleted` is boolean value and only can be specified one times."},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"The request as below::"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"da6895a0_52045114","line":70,"in_reply_to":"da6895a0_76ade930","updated":"2016-10-21 18:46:55.000000000","message":"I mean, admin can accept a very large set of query params from db table, we will create a schema for that in order to validate input param?","commit_id":"1fce336b5d86cdc119bb3347b61beced8646edbd"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"869937fea9ac65e6a95da2ba62dfb78ac7eafda4","unresolved":false,"context_lines":[{"line_number":67,"context_line":"* `name` accepts a regex string. It only can be specified one times."},{"line_number":68,"context_line":"* `sort_key` can accept a string, the valid string are `created_at` and"},{"line_number":69,"context_line":"  `updated_at`. It can be specified multiple times."},{"line_number":70,"context_line":"* `deleted` is boolean value and only can be specified one times."},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"The request as below::"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"da6895a0_76ade930","line":70,"in_reply_to":"fa6399be_60691bf9","updated":"2016-10-21 01:59:43.000000000","message":"I guess not, the json-schema is just for the format validation. So the check for admin or non-admin is out of the scope","commit_id":"1fce336b5d86cdc119bb3347b61beced8646edbd"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"01527631ed01b0f8149b576b85967f1b2d90a886","unresolved":false,"context_lines":[{"line_number":10,"context_line":""},{"line_number":11,"context_line":"https://blueprints.launchpad.net/nova/+spec/consistent-query-parameters-validation"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Currently the query parameters werevalidated with freestyle in each API method."},{"line_number":14,"context_line":"It makes the API code hard to maintenance and error-prone. This specs aims to"},{"line_number":15,"context_line":"propose one consistent mechanism to validate the query parameters."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"ba5da102_d8f4895c","line":13,"range":{"start_line":13,"start_character":31,"end_line":13,"end_character":45},"updated":"2016-11-02 09:43:28.000000000","message":"typo missing space","commit_id":"2fe07222daf34aba6e9029d80618f6b032e7cc28"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"691d1f461f41531f83f2548c118bd23cc288bf30","unresolved":false,"context_lines":[{"line_number":10,"context_line":""},{"line_number":11,"context_line":"https://blueprints.launchpad.net/nova/+spec/consistent-query-parameters-validation"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Currently the query parameters werevalidated with freestyle in each API method."},{"line_number":14,"context_line":"It makes the API code hard to maintenance and error-prone. This specs aims to"},{"line_number":15,"context_line":"propose one consistent mechanism to validate the query parameters."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"ba5da102_28634943","line":13,"range":{"start_line":13,"start_character":31,"end_line":13,"end_character":45},"in_reply_to":"ba5da102_d8f4895c","updated":"2016-11-03 07:49:57.000000000","message":"Done","commit_id":"2fe07222daf34aba6e9029d80618f6b032e7cc28"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"2ad7a0e0da6410b7ea7bcdbd84f1249b3d0d2435","unresolved":false,"context_lines":[{"line_number":64,"context_line":"* `sort_key` can accept a string, the valid string are `created_at` and"},{"line_number":65,"context_line":"  `updated_at`. It can be specified multiple times."},{"line_number":66,"context_line":"* `deleted` is boolean value and only can be specified one times."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"The request as below::"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    The request:"}],"source_content_type":"text/x-rst","patch_set":3,"id":"ba5da102_f37fae14","line":67,"updated":"2016-11-02 09:48:35.000000000","message":"I think you missed sort_dir here?","commit_id":"2fe07222daf34aba6e9029d80618f6b032e7cc28"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"691d1f461f41531f83f2548c118bd23cc288bf30","unresolved":false,"context_lines":[{"line_number":64,"context_line":"* `sort_key` can accept a string, the valid string are `created_at` and"},{"line_number":65,"context_line":"  `updated_at`. It can be specified multiple times."},{"line_number":66,"context_line":"* `deleted` is boolean value and only can be specified one times."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"The request as below::"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    The request:"}],"source_content_type":"text/x-rst","patch_set":3,"id":"ba5da102_a8575956","line":67,"in_reply_to":"ba5da102_f084f90b","updated":"2016-11-03 07:49:57.000000000","message":"yea, this is just an example","commit_id":"2fe07222daf34aba6e9029d80618f6b032e7cc28"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"afe97505d43ee31265fb7175239011b93f8ba26c","unresolved":false,"context_lines":[{"line_number":64,"context_line":"* `sort_key` can accept a string, the valid string are `created_at` and"},{"line_number":65,"context_line":"  `updated_at`. It can be specified multiple times."},{"line_number":66,"context_line":"* `deleted` is boolean value and only can be specified one times."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"The request as below::"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    The request:"}],"source_content_type":"text/x-rst","patch_set":3,"id":"ba5da102_f084f90b","line":67,"in_reply_to":"ba5da102_f37fae14","updated":"2016-11-02 13:51:04.000000000","message":"This is just an example, so thats fine.","commit_id":"2fe07222daf34aba6e9029d80618f6b032e7cc28"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"afe97505d43ee31265fb7175239011b93f8ba26c","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        }"},{"line_number":118,"context_line":"        ..."},{"line_number":119,"context_line":"    }"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"Alternatives"},{"line_number":122,"context_line":"------------"},{"line_number":123,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"ba5da102_f03dd9dd","line":120,"updated":"2016-11-02 13:51:04.000000000","message":"Would it make sense to use the framework in a simple example, like keypairs first?\n\nThat skips the use case of multi_params, but it does hit all the different schema for different micro-versions case.\n\nWe don\u0027t talk about what happens when there are additional properties in the query string, do we hide those from the code somehow? Like we modify the dict to remove bad params?\n\nIn later microversions that don\u0027t allow additional properties, we don\u0027t need that, it would just get 400 error. We should talk about our plans for adding those, I think.","commit_id":"2fe07222daf34aba6e9029d80618f6b032e7cc28"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"691d1f461f41531f83f2548c118bd23cc288bf30","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        }"},{"line_number":118,"context_line":"        ..."},{"line_number":119,"context_line":"    }"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"Alternatives"},{"line_number":122,"context_line":"------------"},{"line_number":123,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"ba5da102_2b9ee3b8","line":120,"in_reply_to":"ba5da102_f03dd9dd","updated":"2016-11-03 07:49:57.000000000","message":"good idea, Keypair is a good simple example. `user_id` is added in 2.10, pagination parameter is added in 2.35. I will add that.\n\nYea, I will add more word about the plan. How to use \"additional properties\", like how we strict the validation in the future.","commit_id":"2fe07222daf34aba6e9029d80618f6b032e7cc28"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"afe97505d43ee31265fb7175239011b93f8ba26c","unresolved":false,"context_lines":[{"line_number":168,"context_line":"This proposal will ease the burden of maintenance the API code with new"},{"line_number":169,"context_line":"mechanism for the developers."},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"The developer needs put the code about validation into the JSON-schema, the"},{"line_number":172,"context_line":"code about data type conversion into the VersionObject."},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"Implementation"},{"line_number":175,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":3,"id":"ba5da102_90b73dd7","line":172,"range":{"start_line":171,"start_character":70,"end_line":172,"end_character":55},"updated":"2016-11-02 13:51:04.000000000","message":"need to drop that bit, I think?","commit_id":"2fe07222daf34aba6e9029d80618f6b032e7cc28"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"691d1f461f41531f83f2548c118bd23cc288bf30","unresolved":false,"context_lines":[{"line_number":168,"context_line":"This proposal will ease the burden of maintenance the API code with new"},{"line_number":169,"context_line":"mechanism for the developers."},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"The developer needs put the code about validation into the JSON-schema, the"},{"line_number":172,"context_line":"code about data type conversion into the VersionObject."},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"Implementation"},{"line_number":175,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":3,"id":"ba5da102_0bb4bf32","line":172,"range":{"start_line":171,"start_character":70,"end_line":172,"end_character":55},"in_reply_to":"ba5da102_90b73dd7","updated":"2016-11-03 07:49:57.000000000","message":"oops, missed that bit. I will drop it","commit_id":"2fe07222daf34aba6e9029d80618f6b032e7cc28"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"afe97505d43ee31265fb7175239011b93f8ba26c","unresolved":false,"context_lines":[{"line_number":186,"context_line":"Work Items"},{"line_number":187,"context_line":"----------"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"TODO"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"Dependencies"},{"line_number":192,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":3,"id":"ba5da102_10cc0d69","line":189,"updated":"2016-11-02 13:51:04.000000000","message":"Maybe this should be:\n\n* introduce framework\n* apply framework to /keypairs","commit_id":"2fe07222daf34aba6e9029d80618f6b032e7cc28"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"691d1f461f41531f83f2548c118bd23cc288bf30","unresolved":false,"context_lines":[{"line_number":186,"context_line":"Work Items"},{"line_number":187,"context_line":"----------"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"TODO"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"Dependencies"},{"line_number":192,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":3,"id":"ba5da102_4b887771","line":189,"in_reply_to":"ba5da102_10cc0d69","updated":"2016-11-03 07:49:57.000000000","message":"Done","commit_id":"2fe07222daf34aba6e9029d80618f6b032e7cc28"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"afe97505d43ee31265fb7175239011b93f8ba26c","unresolved":false,"context_lines":[{"line_number":191,"context_line":"Dependencies"},{"line_number":192,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"TODO"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"Testing"},{"line_number":197,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":3,"id":"ba5da102_50c20535","line":194,"updated":"2016-11-02 13:51:04.000000000","message":"I think None?","commit_id":"2fe07222daf34aba6e9029d80618f6b032e7cc28"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"691d1f461f41531f83f2548c118bd23cc288bf30","unresolved":false,"context_lines":[{"line_number":191,"context_line":"Dependencies"},{"line_number":192,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"TODO"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"Testing"},{"line_number":197,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":3,"id":"ba5da102_8b7e0f68","line":194,"in_reply_to":"ba5da102_50c20535","updated":"2016-11-03 07:49:57.000000000","message":"Done","commit_id":"2fe07222daf34aba6e9029d80618f6b032e7cc28"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f7389505ee5972dc262a88a8e917657093049455","unresolved":false,"context_lines":[{"line_number":10,"context_line":""},{"line_number":11,"context_line":"https://blueprints.launchpad.net/nova/+spec/consistent-query-parameters-validation"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Currently the query parameters were validated with freestyle in each API"},{"line_number":14,"context_line":"method. It makes the API code hard to maintenance and error-prone. This specs"},{"line_number":15,"context_line":"aims to propose one consistent mechanism to validate the query parameters."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_5c9de908","line":13,"range":{"start_line":13,"start_character":46,"end_line":13,"end_character":60},"updated":"2016-11-09 18:17:30.000000000","message":"This is confusing. Perhaps change this to:\n\n Currently query parameters are validated ad-hoc in each API method\n in inconsistent ways.","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f7389505ee5972dc262a88a8e917657093049455","unresolved":false,"context_lines":[{"line_number":11,"context_line":"https://blueprints.launchpad.net/nova/+spec/consistent-query-parameters-validation"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Currently the query parameters were validated with freestyle in each API"},{"line_number":14,"context_line":"method. It makes the API code hard to maintenance and error-prone. This specs"},{"line_number":15,"context_line":"aims to propose one consistent mechanism to validate the query parameters."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Problem description"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_7ca2ad4c","line":14,"range":{"start_line":14,"start_character":38,"end_line":14,"end_character":49},"updated":"2016-11-09 18:17:30.000000000","message":"\"maintain\"","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f7389505ee5972dc262a88a8e917657093049455","unresolved":false,"context_lines":[{"line_number":11,"context_line":"https://blueprints.launchpad.net/nova/+spec/consistent-query-parameters-validation"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Currently the query parameters were validated with freestyle in each API"},{"line_number":14,"context_line":"method. It makes the API code hard to maintenance and error-prone. This specs"},{"line_number":15,"context_line":"aims to propose one consistent mechanism to validate the query parameters."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Problem description"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_fc8ebdce","line":14,"range":{"start_line":14,"start_character":72,"end_line":14,"end_character":77},"updated":"2016-11-09 18:17:30.000000000","message":"\"spec\"","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f7389505ee5972dc262a88a8e917657093049455","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Currently the query parameters were validated with freestyle in each API"},{"line_number":14,"context_line":"method. It makes the API code hard to maintenance and error-prone. This specs"},{"line_number":15,"context_line":"aims to propose one consistent mechanism to validate the query parameters."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Problem description"},{"line_number":18,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_5cb40981","line":15,"range":{"start_line":15,"start_character":53,"end_line":15,"end_character":56},"updated":"2016-11-09 18:17:30.000000000","message":"s/the//","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f7389505ee5972dc262a88a8e917657093049455","unresolved":false,"context_lines":[{"line_number":17,"context_line":"Problem description"},{"line_number":18,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"The API layer supports to validate the input body with json-schema, and"},{"line_number":21,"context_line":"there are a set of mechanism to support Microversion. But look at the query"},{"line_number":22,"context_line":"parameter\u0027s validation, those are just some freestyle code in the"},{"line_number":23,"context_line":"API method. Due to no control on those query parameters, we have a set of"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_dc2d79a9","line":20,"range":{"start_line":20,"start_character":23,"end_line":20,"end_character":33},"updated":"2016-11-09 18:17:30.000000000","message":"\"validating\"","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f7389505ee5972dc262a88a8e917657093049455","unresolved":false,"context_lines":[{"line_number":18,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"The API layer supports to validate the input body with json-schema, and"},{"line_number":21,"context_line":"there are a set of mechanism to support Microversion. But look at the query"},{"line_number":22,"context_line":"parameter\u0027s validation, those are just some freestyle code in the"},{"line_number":23,"context_line":"API method. Due to no control on those query parameters, we have a set of"},{"line_number":24,"context_line":"problem:"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_7c154d47","line":21,"range":{"start_line":21,"start_character":19,"end_line":21,"end_character":52},"updated":"2016-11-09 18:17:30.000000000","message":"s/mechanism/mechanisms/\n\ns/support Microversion/support microversions/","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f7389505ee5972dc262a88a8e917657093049455","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"The API layer supports to validate the input body with json-schema, and"},{"line_number":21,"context_line":"there are a set of mechanism to support Microversion. But look at the query"},{"line_number":22,"context_line":"parameter\u0027s validation, those are just some freestyle code in the"},{"line_number":23,"context_line":"API method. Due to no control on those query parameters, we have a set of"},{"line_number":24,"context_line":"problem:"},{"line_number":25,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_5006ad1d","line":22,"updated":"2016-11-09 18:17:30.000000000","message":"This whole sentence can probably go.","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f7389505ee5972dc262a88a8e917657093049455","unresolved":false,"context_lines":[{"line_number":23,"context_line":"API method. Due to no control on those query parameters, we have a set of"},{"line_number":24,"context_line":"problem:"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"* Freestyle query parameter validation in the API method. The similar query"},{"line_number":27,"context_line":"  parameter have different validation. Or some query parameters just lose any"},{"line_number":28,"context_line":"  validation."},{"line_number":29,"context_line":"* A lot of code branch for different microversion logic spread in multiple"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_10199579","line":26,"range":{"start_line":26,"start_character":2,"end_line":26,"end_character":11},"updated":"2016-11-09 18:17:30.000000000","message":"s/Freestyle/Inconsistent/","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f7389505ee5972dc262a88a8e917657093049455","unresolved":false,"context_lines":[{"line_number":30,"context_line":"  places. It makes the code hard to read."},{"line_number":31,"context_line":"* Without deep into the code, the developer can\u0027t know what query parameters"},{"line_number":32,"context_line":"  supported by the API. And there are some query parameters just pass into"},{"line_number":33,"context_line":"  the SQL query directly."},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"Use Cases"},{"line_number":36,"context_line":"---------"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_705571f8","line":33,"updated":"2016-11-09 18:17:30.000000000","message":"I lost steam with the grammar nits about here. Maybe you can take another close pass through this to fix things up? Or, I can do it and push up a revision.","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"410590a02ef1381d9d209154976bf24a8ac3b9a4","unresolved":false,"context_lines":[{"line_number":30,"context_line":"  places. It makes the code hard to read."},{"line_number":31,"context_line":"* Without deep into the code, the developer can\u0027t know what query parameters"},{"line_number":32,"context_line":"  supported by the API. And there are some query parameters just pass into"},{"line_number":33,"context_line":"  the SQL query directly."},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"Use Cases"},{"line_number":36,"context_line":"---------"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_571f6807","line":33,"in_reply_to":"9a629dbe_705571f8","updated":"2016-11-10 10:08:45.000000000","message":"I will try to fix them, thanks","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f7389505ee5972dc262a88a8e917657093049455","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"This is an effort about refactor the API layer code, to ease the burden of"},{"line_number":39,"context_line":"maintenance API code. So there isn\u0027t any use-cases for the end-user. The"},{"line_number":40,"context_line":"use-cases is all for the developers:"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"* The developers needs a consistent validation and parsing mechanism for the"},{"line_number":43,"context_line":"  query parameters."}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_1047d54b","line":40,"updated":"2016-11-09 18:17:30.000000000","message":"None of this proposes to increase the parameter validation in a meaningful way? I guess I thought that in addition to better maintainability, we were also gaining some safety in our checks.. no?","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"410590a02ef1381d9d209154976bf24a8ac3b9a4","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"This is an effort about refactor the API layer code, to ease the burden of"},{"line_number":39,"context_line":"maintenance API code. So there isn\u0027t any use-cases for the end-user. The"},{"line_number":40,"context_line":"use-cases is all for the developers:"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"* The developers needs a consistent validation and parsing mechanism for the"},{"line_number":43,"context_line":"  query parameters."}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_57d048f6","line":40,"in_reply_to":"9a629dbe_1047d54b","updated":"2016-11-10 10:08:45.000000000","message":"I\u0027m little not sure what you mean....you mean just talk about the maintainability and gaining safety in our checks?","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f7389505ee5972dc262a88a8e917657093049455","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    The request:"},{"line_number":71,"context_line":"     GET http://openstack.example.com/v2.1/servers?name\u003dabc\u0026sort_key\u003dcreated_at\u0026sork_key\u003dupdated_at\u0026deleted\u003dTrue"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"The query parameters conver to a flat JSON data::"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    {"},{"line_number":76,"context_line":"        \u0027name\u0027: \u0027^abc\u0027,"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_b0df0968","line":73,"range":{"start_line":73,"start_character":21,"end_line":73,"end_character":27},"updated":"2016-11-09 18:17:30.000000000","message":"\"convert\" ?","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"649986b7fee67aed13fee1f2add469ed5a97676e","unresolved":false,"context_lines":[{"line_number":84,"context_line":"    {"},{"line_number":85,"context_line":"        type\u0027: \u0027object\u0027,"},{"line_number":86,"context_line":"        \u0027properties\u0027: {"},{"line_number":87,"context_line":"            \u0027name\u0027: {\u0027type\u0027: \u0027string\u0027, \u0027format\u0027: \u0027regex\u0027},"},{"line_number":88,"context_line":"            \u0027sort_key\u0027: {\u0027oneOf\u0027: ["},{"line_number":89,"context_line":"                {\u0027type\u0027: \u0027array\u0027, \u0027items\u0027: {\u0027type\u0027: \u0027string\u0027}},"},{"line_number":90,"context_line":"                {\u0027type\u0027: \u0027string\u0027, \u0027enum\u0027: [\u0027created_at\u0027, \u0027updated_at\u0027]}"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_3347764c","line":87,"range":{"start_line":87,"start_character":20,"end_line":87,"end_character":58},"updated":"2016-11-10 05:59:17.000000000","message":"should we strict this same as name schema we have while creating server-\n\nhttps://github.com/openstack/nova/blob/master/nova/api/openstack/compute/schemas/servers.py#L27\n\nAlso as per L101, we need name schema with oneOf allowing array also like sort_key.","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"410590a02ef1381d9d209154976bf24a8ac3b9a4","unresolved":false,"context_lines":[{"line_number":84,"context_line":"    {"},{"line_number":85,"context_line":"        type\u0027: \u0027object\u0027,"},{"line_number":86,"context_line":"        \u0027properties\u0027: {"},{"line_number":87,"context_line":"            \u0027name\u0027: {\u0027type\u0027: \u0027string\u0027, \u0027format\u0027: \u0027regex\u0027},"},{"line_number":88,"context_line":"            \u0027sort_key\u0027: {\u0027oneOf\u0027: ["},{"line_number":89,"context_line":"                {\u0027type\u0027: \u0027array\u0027, \u0027items\u0027: {\u0027type\u0027: \u0027string\u0027}},"},{"line_number":90,"context_line":"                {\u0027type\u0027: \u0027string\u0027, \u0027enum\u0027: [\u0027created_at\u0027, \u0027updated_at\u0027]}"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_372834e2","line":87,"range":{"start_line":87,"start_character":20,"end_line":87,"end_character":58},"in_reply_to":"9a629dbe_3347764c","updated":"2016-11-10 10:08:45.000000000","message":"Yea, maybe, but that is in the future, this is just an example at here.","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"9515025a7d1b95b9dc07af3940ff616ea6afb7f5","unresolved":false,"context_lines":[{"line_number":84,"context_line":"    {"},{"line_number":85,"context_line":"        type\u0027: \u0027object\u0027,"},{"line_number":86,"context_line":"        \u0027properties\u0027: {"},{"line_number":87,"context_line":"            \u0027name\u0027: {\u0027type\u0027: \u0027string\u0027, \u0027format\u0027: \u0027regex\u0027},"},{"line_number":88,"context_line":"            \u0027sort_key\u0027: {\u0027oneOf\u0027: ["},{"line_number":89,"context_line":"                {\u0027type\u0027: \u0027array\u0027, \u0027items\u0027: {\u0027type\u0027: \u0027string\u0027}},"},{"line_number":90,"context_line":"                {\u0027type\u0027: \u0027string\u0027, \u0027enum\u0027: [\u0027created_at\u0027, \u0027updated_at\u0027]}"}],"source_content_type":"text/x-rst","patch_set":4,"id":"7a77a97e_53db90ed","line":87,"range":{"start_line":87,"start_character":20,"end_line":87,"end_character":58},"in_reply_to":"9a629dbe_372834e2","updated":"2016-11-15 05:16:10.000000000","message":"yea we can do while restricting the list for query param which is another spec anyways.","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f7389505ee5972dc262a88a8e917657093049455","unresolved":false,"context_lines":[{"line_number":116,"context_line":"            ..."},{"line_number":117,"context_line":"        }"},{"line_number":118,"context_line":"        ..."},{"line_number":119,"context_line":"    }"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"The schema will be attched to each API by an new decorator::"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_703f3187","line":119,"updated":"2016-11-09 18:17:30.000000000","message":"Query strings can have multiple values for the same key, i.e:\n\n ?foo\u003d1\u0026foo\u003d2\u0026bar\u003dbaz\n\nHow do we handle that in this schema?","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"9515025a7d1b95b9dc07af3940ff616ea6afb7f5","unresolved":false,"context_lines":[{"line_number":116,"context_line":"            ..."},{"line_number":117,"context_line":"        }"},{"line_number":118,"context_line":"        ..."},{"line_number":119,"context_line":"    }"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"The schema will be attched to each API by an new decorator::"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"7a77a97e_135af883","line":119,"in_reply_to":"9a629dbe_125a5e2a","updated":"2016-11-15 05:16:10.000000000","message":"this is nice but how to verify if query has same key multiple times like ?name\u003d1212\u0026name\u003d\u0027correct\u0027\n\nin that case we will prepare a json object from that which will end up having name multiple times.\n\nfurther json schema like @L80 will pass this object even it has multiple name (one with incorrect value) because current json schema does not take care for multiple occurrence of same element inside object.\n\nWe have same issue for request body validation also.\n\nBut I think we can take this as rare case and fix later ?","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"410590a02ef1381d9d209154976bf24a8ac3b9a4","unresolved":false,"context_lines":[{"line_number":116,"context_line":"            ..."},{"line_number":117,"context_line":"        }"},{"line_number":118,"context_line":"        ..."},{"line_number":119,"context_line":"    }"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"The schema will be attched to each API by an new decorator::"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_125a5e2a","line":119,"in_reply_to":"9a629dbe_388f4e76","updated":"2016-11-10 10:08:45.000000000","message":"The multiple values support is done by marco function \u0027multi_params\u0027. The \u0027multi_params\u0027 will output the schema as line 88.\n\nBut looks like 88 isn\u0027t correct, it should be:\n\n\u0027sort_key\u0027: {\u0027oneOf\u0027: [\n                {\u0027type\u0027: \u0027array\u0027, \u0027items\u0027: {\u0027type\u0027: \u0027string\u0027, \u0027enum\u0027: [\u0027created_at\u0027, \u0027updated_at\u0027]}},\n                {\u0027type\u0027: \u0027string\u0027, \u0027enum\u0027: [\u0027created_at\u0027, \u0027updated_at\u0027]}\n            ]},\n\nI will correct it.","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"649986b7fee67aed13fee1f2add469ed5a97676e","unresolved":false,"context_lines":[{"line_number":116,"context_line":"            ..."},{"line_number":117,"context_line":"        }"},{"line_number":118,"context_line":"        ..."},{"line_number":119,"context_line":"    }"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"The schema will be attched to each API by an new decorator::"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_388f4e76","line":119,"in_reply_to":"9a629dbe_703f3187","updated":"2016-11-10 05:59:17.000000000","message":"nice catch, i think in current json schema we can validate uniqueness of item in array only using uniqueItems. In case where instance is object, it is hard to do that. \nSame issue we have with request body validation also where if duplicate items are present then, json schema consider the either one which is correct.","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f7389505ee5972dc262a88a8e917657093049455","unresolved":false,"context_lines":[{"line_number":141,"context_line":"    schema_v2_10[\u0027properties\u0027] \u003d {\u0027user_id\u0027: multi_params({\u0027type\u0027: \u0027string\u0027}}"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    schema_v2_35 \u003d copy.deepcopy(schema_v2_10)"},{"line_number":144,"context_line":"    schema_v2_35[\u0027properties\u0027][\u0027limit\u0027] \u003d multie_params("},{"line_number":145,"context_line":"        {\u0027type\u0027: \u0027string\u0027, \u0027format\u0027: \u0027integer\u0027})"},{"line_number":146,"context_line":"    schema_v2_35[\u0027properties\u0027][\u0027marker\u0027] \u003d multi_params({\u0027type\u0027: \u0027string\u0027})"},{"line_number":147,"context_line":"    @validation.query_params_schema(schema_v2_35, \u00272.35\u0027)"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_1016f5f0","line":144,"range":{"start_line":144,"start_character":42,"end_line":144,"end_character":55},"updated":"2016-11-09 18:17:30.000000000","message":"\"multi_params\"","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e8468b46220a6661d715e289ddf0754e1b078e38","unresolved":false,"context_lines":[{"line_number":156,"context_line":"matching the current behaviour, we need to enable multiple values for all the"},{"line_number":157,"context_line":"parameters(using the macro function \u0027multi_params\u0027 to extra the schema of"},{"line_number":158,"context_line":"multiple values). And this will be the same strategy when we using the schema"},{"line_number":159,"context_line":"for the other APIs."},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"Alternatives"},{"line_number":162,"context_line":"------------"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_acc5048f","line":159,"updated":"2016-11-09 13:37:53.000000000","message":"I am keen that when \u0027additionalProperties\u0027: True we strip out all the addtional properties in the validation layer, so the api code has no access to unknown properties.\n\nIn the future, \u0027additionalProperties\u0027: False in a microversion, and we can always error out on 400 errors.\n\nBasically, ensure dodgy requests that used to work keep working, but they are made \"safe\".","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"04695bede49f4dbc0d7401ece0b93dac02fc813e","unresolved":false,"context_lines":[{"line_number":156,"context_line":"matching the current behaviour, we need to enable multiple values for all the"},{"line_number":157,"context_line":"parameters(using the macro function \u0027multi_params\u0027 to extra the schema of"},{"line_number":158,"context_line":"multiple values). And this will be the same strategy when we using the schema"},{"line_number":159,"context_line":"for the other APIs."},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"Alternatives"},{"line_number":162,"context_line":"------------"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_c032cba6","line":159,"in_reply_to":"9a629dbe_12a89eda","updated":"2016-11-10 12:27:24.000000000","message":"Looks like \u0027req.GET\u0027 is just a copy of data https://github.com/Pylons/webob/blob/master/webob/request.py#L833\n\nI need to find out a way to strip the additional parameters.","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"410590a02ef1381d9d209154976bf24a8ac3b9a4","unresolved":false,"context_lines":[{"line_number":156,"context_line":"matching the current behaviour, we need to enable multiple values for all the"},{"line_number":157,"context_line":"parameters(using the macro function \u0027multi_params\u0027 to extra the schema of"},{"line_number":158,"context_line":"multiple values). And this will be the same strategy when we using the schema"},{"line_number":159,"context_line":"for the other APIs."},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"Alternatives"},{"line_number":162,"context_line":"------------"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_12a89eda","line":159,"in_reply_to":"9a629dbe_70dbb14f","updated":"2016-11-10 10:08:45.000000000","message":"yea, thanks John point that out. I will strip the additional properties from the \u0027req.GET\u0027","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f7389505ee5972dc262a88a8e917657093049455","unresolved":false,"context_lines":[{"line_number":156,"context_line":"matching the current behaviour, we need to enable multiple values for all the"},{"line_number":157,"context_line":"parameters(using the macro function \u0027multi_params\u0027 to extra the schema of"},{"line_number":158,"context_line":"multiple values). And this will be the same strategy when we using the schema"},{"line_number":159,"context_line":"for the other APIs."},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"Alternatives"},{"line_number":162,"context_line":"------------"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_70dbb14f","line":159,"in_reply_to":"9a629dbe_acc5048f","updated":"2016-11-09 18:17:30.000000000","message":"Yeah, good call.","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"58cd6e9f8a0c01d358948f0e084d013240a0cb6f","unresolved":false,"context_lines":[{"line_number":156,"context_line":"matching the current behaviour, we need to enable multiple values for all the"},{"line_number":157,"context_line":"parameters(using the macro function \u0027multi_params\u0027 to extra the schema of"},{"line_number":158,"context_line":"multiple values). And this will be the same strategy when we using the schema"},{"line_number":159,"context_line":"for the other APIs."},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"Alternatives"},{"line_number":162,"context_line":"------------"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a629dbe_1b98b2bf","line":159,"in_reply_to":"9a629dbe_c032cba6","updated":"2016-11-10 12:44:57.000000000","message":"Checked again, it works, the operation of dict will update the env also.","commit_id":"41da266bb991f59adf662e89353c0cbeb6f79d4c"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"2bb639a922280af1cb2fa0dede8417c891a80c9b","unresolved":false,"context_lines":[{"line_number":166,"context_line":""},{"line_number":167,"context_line":"When the value of `additionalProperties` is `True` means the extra query"},{"line_number":168,"context_line":"parameters are allowed. But those extra query parameters will be stripped out"},{"line_number":169,"context_line":"from the `req.GET`. When the value of `additionalProperties` is `False` means"},{"line_number":170,"context_line":"the extra query aren\u0027t allowed."},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"The value of `additionalProperties` will be `True` until we decide to strict"}],"source_content_type":"text/x-rst","patch_set":5,"id":"9a629dbe_f883ff53","line":169,"range":{"start_line":169,"start_character":5,"end_line":169,"end_character":17},"updated":"2016-11-10 13:53:10.000000000","message":"Talk with John on the IRC, he feels that modifing the req.GET direclty is a little trick, but with this way, folks can keep doing the \"normal\" thing.\n\nAnother way in my mind is that the decorator will add new parameter to the API method, the allowed query parameters will be copied into that parameter.\n\nFor example:\n\n@validation.query_params_schema(schema_v2_1, \u00272.1\u0027, \u00272.9)\ndef index(req, query_params):\n    ...\n\nThe query_params include the query parameters after strip out the extra bits.\n\nThat also can be the detail of implement, I will remove the bits talk about req.GET. Then I will update the PoC to show what looks like in the code.","commit_id":"a34cb9ebd44d73451b792a9e3bd54cae53fe1252"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"79ef4adbd939620dac2cd0d0760a737f67aab930","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        {\u0027type\u0027: \u0027string\u0027, \u0027format\u0027: \u0027integer\u0027})"},{"line_number":160,"context_line":"    schema_v2_35[\u0027properties\u0027][\u0027marker\u0027] \u003d multi_params({\u0027type\u0027: \u0027string\u0027})"},{"line_number":161,"context_line":"    @validation.query_params_schema(schema_v2_35, \u00272.35\u0027)"},{"line_number":162,"context_line":"    @validation.query_params_schema(schema_v2_10, \u00272.10\u0027, \u00272.35\u0027)"},{"line_number":163,"context_line":"    @validation.query_params_schema(schema_v2_1, \u00272.1\u0027, \u00272.9)"},{"line_number":164,"context_line":"    def index(req):"},{"line_number":165,"context_line":"        ...."}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a629dbe_a6f581cc","line":162,"updated":"2016-11-14 13:07:14.000000000","message":"Is max_version inclusive or exclusive? Is there an overlap in this example?","commit_id":"11011224b6676dfcd30bb464eec390c43ee89d3a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"6a005090e8cd5555a5564ba1a0d7a7114612a85f","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        {\u0027type\u0027: \u0027string\u0027, \u0027format\u0027: \u0027integer\u0027})"},{"line_number":160,"context_line":"    schema_v2_35[\u0027properties\u0027][\u0027marker\u0027] \u003d multi_params({\u0027type\u0027: \u0027string\u0027})"},{"line_number":161,"context_line":"    @validation.query_params_schema(schema_v2_35, \u00272.35\u0027)"},{"line_number":162,"context_line":"    @validation.query_params_schema(schema_v2_10, \u00272.10\u0027, \u00272.35\u0027)"},{"line_number":163,"context_line":"    @validation.query_params_schema(schema_v2_1, \u00272.1\u0027, \u00272.9)"},{"line_number":164,"context_line":"    def index(req):"},{"line_number":165,"context_line":"        ...."}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a629dbe_814a2726","line":162,"in_reply_to":"9a629dbe_a6f581cc","updated":"2016-11-14 13:29:18.000000000","message":"nice catch, the max_version is inclusive. there should be \u00272.34\u0027.","commit_id":"11011224b6676dfcd30bb464eec390c43ee89d3a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"06a146e71ebe75fce4c9addd825d69b7346634df","unresolved":false,"context_lines":[{"line_number":22,"context_line":"there are a set of mechanisms to support microversion. But no control on those"},{"line_number":23,"context_line":"query parameters, we have a set of problem:"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"* Inconsistent query parameter validation in the API method. The similar query"},{"line_number":26,"context_line":"  parameter have different validation. Or some query parameters are without any"},{"line_number":27,"context_line":"  validation."},{"line_number":28,"context_line":"* Without deep into the code, the developer can\u0027t know which query parameters"},{"line_number":29,"context_line":"  are supported by the API. And there are some query parameters just pass into"},{"line_number":30,"context_line":"  the SQL query directly."}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_36da9879","line":27,"range":{"start_line":25,"start_character":61,"end_line":27,"end_character":13},"updated":"2016-11-14 18:34:35.000000000","message":"Just a suggestion, but a couple of examples could be useful here.\n\nLike changes-since is a good example of query parameter validation in the code:\n\nhttps://github.com/openstack/nova/blob/00bc0cb53d6113fae9a7714386953d1d75db71c1/nova/api/openstack/compute/servers.py#L244\n\nOr start/end here:\n\nhttps://github.com/openstack/nova/blob/00bc0cb53d6113fae9a7714386953d1d75db71c1/nova/api/openstack/compute/simple_tenant_usage.py#L178\n\nWhich could be easy as a jsonschema as a date-time type.","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"4b38f8b32f669ef72543b3fa648c2825ad4ec98e","unresolved":false,"context_lines":[{"line_number":22,"context_line":"there are a set of mechanisms to support microversion. But no control on those"},{"line_number":23,"context_line":"query parameters, we have a set of problem:"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"* Inconsistent query parameter validation in the API method. The similar query"},{"line_number":26,"context_line":"  parameter have different validation. Or some query parameters are without any"},{"line_number":27,"context_line":"  validation."},{"line_number":28,"context_line":"* Without deep into the code, the developer can\u0027t know which query parameters"},{"line_number":29,"context_line":"  are supported by the API. And there are some query parameters just pass into"},{"line_number":30,"context_line":"  the SQL query directly."}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_735b2c55","line":27,"range":{"start_line":25,"start_character":61,"end_line":27,"end_character":13},"in_reply_to":"7a77a97e_36da9879","updated":"2016-11-15 05:52:23.000000000","message":"Done","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"06a146e71ebe75fce4c9addd825d69b7346634df","unresolved":false,"context_lines":[{"line_number":25,"context_line":"* Inconsistent query parameter validation in the API method. The similar query"},{"line_number":26,"context_line":"  parameter have different validation. Or some query parameters are without any"},{"line_number":27,"context_line":"  validation."},{"line_number":28,"context_line":"* Without deep into the code, the developer can\u0027t know which query parameters"},{"line_number":29,"context_line":"  are supported by the API. And there are some query parameters just pass into"},{"line_number":30,"context_line":"  the SQL query directly."},{"line_number":31,"context_line":""}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_9687ec11","line":28,"range":{"start_line":28,"start_character":10,"end_line":28,"end_character":14},"updated":"2016-11-14 18:34:35.000000000","message":"s/deep/looking deep/","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"4b38f8b32f669ef72543b3fa648c2825ad4ec98e","unresolved":false,"context_lines":[{"line_number":25,"context_line":"* Inconsistent query parameter validation in the API method. The similar query"},{"line_number":26,"context_line":"  parameter have different validation. Or some query parameters are without any"},{"line_number":27,"context_line":"  validation."},{"line_number":28,"context_line":"* Without deep into the code, the developer can\u0027t know which query parameters"},{"line_number":29,"context_line":"  are supported by the API. And there are some query parameters just pass into"},{"line_number":30,"context_line":"  the SQL query directly."},{"line_number":31,"context_line":""}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_532550c0","line":28,"range":{"start_line":28,"start_character":10,"end_line":28,"end_character":14},"in_reply_to":"7a77a97e_9687ec11","updated":"2016-11-15 05:52:23.000000000","message":"Done","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"06a146e71ebe75fce4c9addd825d69b7346634df","unresolved":false,"context_lines":[{"line_number":26,"context_line":"  parameter have different validation. Or some query parameters are without any"},{"line_number":27,"context_line":"  validation."},{"line_number":28,"context_line":"* Without deep into the code, the developer can\u0027t know which query parameters"},{"line_number":29,"context_line":"  are supported by the API. And there are some query parameters just pass into"},{"line_number":30,"context_line":"  the SQL query directly."},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"Use Cases"}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_3679b830","line":29,"range":{"start_line":29,"start_character":64,"end_line":29,"end_character":68},"updated":"2016-11-14 18:34:35.000000000","message":"s/just pass/that are just passed/","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"4b38f8b32f669ef72543b3fa648c2825ad4ec98e","unresolved":false,"context_lines":[{"line_number":26,"context_line":"  parameter have different validation. Or some query parameters are without any"},{"line_number":27,"context_line":"  validation."},{"line_number":28,"context_line":"* Without deep into the code, the developer can\u0027t know which query parameters"},{"line_number":29,"context_line":"  are supported by the API. And there are some query parameters just pass into"},{"line_number":30,"context_line":"  the SQL query directly."},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"Use Cases"}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_73224cbb","line":29,"range":{"start_line":29,"start_character":64,"end_line":29,"end_character":68},"in_reply_to":"7a77a97e_3679b830","updated":"2016-11-15 05:52:23.000000000","message":"Done","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"06a146e71ebe75fce4c9addd825d69b7346634df","unresolved":false,"context_lines":[{"line_number":27,"context_line":"  validation."},{"line_number":28,"context_line":"* Without deep into the code, the developer can\u0027t know which query parameters"},{"line_number":29,"context_line":"  are supported by the API. And there are some query parameters just pass into"},{"line_number":30,"context_line":"  the SQL query directly."},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"Use Cases"},{"line_number":33,"context_line":"---------"}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_56c4743f","line":30,"range":{"start_line":30,"start_character":6,"end_line":30,"end_character":24},"updated":"2016-11-14 18:34:35.000000000","message":"Like sort_keys and sort_dirs:\n\nhttps://github.com/openstack/nova/blob/00bc0cb53d6113fae9a7714386953d1d75db71c1/nova/api/openstack/common.py#L145","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"4b38f8b32f669ef72543b3fa648c2825ad4ec98e","unresolved":false,"context_lines":[{"line_number":27,"context_line":"  validation."},{"line_number":28,"context_line":"* Without deep into the code, the developer can\u0027t know which query parameters"},{"line_number":29,"context_line":"  are supported by the API. And there are some query parameters just pass into"},{"line_number":30,"context_line":"  the SQL query directly."},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"Use Cases"},{"line_number":33,"context_line":"---------"}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_b32ce4ac","line":30,"range":{"start_line":30,"start_character":6,"end_line":30,"end_character":24},"in_reply_to":"7a77a97e_56c4743f","updated":"2016-11-15 05:52:23.000000000","message":"Done","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"06a146e71ebe75fce4c9addd825d69b7346634df","unresolved":false,"context_lines":[{"line_number":33,"context_line":"---------"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"This is an effort about the refactor of the API layer code. It aims to ease the"},{"line_number":36,"context_line":"burden of maintenance API code. So there isn\u0027t any use-case for the end-user."},{"line_number":37,"context_line":"The use-cases is all for the developers:"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"* The developers needs a consistent validation for the query parameters."}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_9611acb2","line":36,"range":{"start_line":36,"start_character":68,"end_line":36,"end_character":76},"updated":"2016-11-14 18:34:35.000000000","message":"You don\u0027t really need to address this probably, but there is an end-user benefit which is consistent query parameter validation, which improves the user experience.","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"06a146e71ebe75fce4c9addd825d69b7346634df","unresolved":false,"context_lines":[{"line_number":33,"context_line":"---------"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"This is an effort about the refactor of the API layer code. It aims to ease the"},{"line_number":36,"context_line":"burden of maintenance API code. So there isn\u0027t any use-case for the end-user."},{"line_number":37,"context_line":"The use-cases is all for the developers:"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"* The developers needs a consistent validation for the query parameters."}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_16f83c7c","line":36,"range":{"start_line":36,"start_character":10,"end_line":36,"end_character":21},"updated":"2016-11-14 18:34:35.000000000","message":"s/maintenance/maintaining/","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"4b38f8b32f669ef72543b3fa648c2825ad4ec98e","unresolved":false,"context_lines":[{"line_number":33,"context_line":"---------"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"This is an effort about the refactor of the API layer code. It aims to ease the"},{"line_number":36,"context_line":"burden of maintenance API code. So there isn\u0027t any use-case for the end-user."},{"line_number":37,"context_line":"The use-cases is all for the developers:"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"* The developers needs a consistent validation for the query parameters."}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_dee88719","line":36,"range":{"start_line":36,"start_character":68,"end_line":36,"end_character":76},"in_reply_to":"7a77a97e_9611acb2","updated":"2016-11-15 05:52:23.000000000","message":"yea, but let me try to make it better.","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"06a146e71ebe75fce4c9addd825d69b7346634df","unresolved":false,"context_lines":[{"line_number":58,"context_line":"* `name` accepts a regex string. It only can be specified one times."},{"line_number":59,"context_line":"* `sort_key` can accept a string, the valid string are `created_at` and"},{"line_number":60,"context_line":"  `updated_at`. It can be specified multiple times."},{"line_number":61,"context_line":"* `deleted` is boolean value and only can be specified one times."},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"The request as below::"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_56fc743e","line":61,"range":{"start_line":61,"start_character":15,"end_line":61,"end_character":22},"updated":"2016-11-14 18:34:35.000000000","message":"I think this can technically be an int or string too given:\n\nhttps://github.com/openstack/nova/blob/00bc0cb53d6113fae9a7714386953d1d75db71c1/nova/api/openstack/compute/servers.py#L266","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"4b38f8b32f669ef72543b3fa648c2825ad4ec98e","unresolved":false,"context_lines":[{"line_number":58,"context_line":"* `name` accepts a regex string. It only can be specified one times."},{"line_number":59,"context_line":"* `sort_key` can accept a string, the valid string are `created_at` and"},{"line_number":60,"context_line":"  `updated_at`. It can be specified multiple times."},{"line_number":61,"context_line":"* `deleted` is boolean value and only can be specified one times."},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"The request as below::"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_3e141bf4","line":61,"range":{"start_line":61,"start_character":15,"end_line":61,"end_character":22},"in_reply_to":"7a77a97e_56fc743e","updated":"2016-11-15 05:52:23.000000000","message":"Actually only can be \u0027string\u0027, due to it in the URL query string.\n\nAnyway it is just an example, what it looks like in the reality should be in the spec https://review.openstack.org/393205","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"06a146e71ebe75fce4c9addd825d69b7346634df","unresolved":false,"context_lines":[{"line_number":59,"context_line":"* `sort_key` can accept a string, the valid string are `created_at` and"},{"line_number":60,"context_line":"  `updated_at`. It can be specified multiple times."},{"line_number":61,"context_line":"* `deleted` is boolean value and only can be specified one times."},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"The request as below::"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    The request:"}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_d6596490","line":62,"updated":"2016-11-14 18:34:35.000000000","message":"all_tenants is also fun because it can be an int, string or a boolean:\n\nhttps://github.com/openstack/nova/blob/00bc0cb53d6113fae9a7714386953d1d75db71c1/nova/api/openstack/common.py#L521","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"4b38f8b32f669ef72543b3fa648c2825ad4ec98e","unresolved":false,"context_lines":[{"line_number":59,"context_line":"* `sort_key` can accept a string, the valid string are `created_at` and"},{"line_number":60,"context_line":"  `updated_at`. It can be specified multiple times."},{"line_number":61,"context_line":"* `deleted` is boolean value and only can be specified one times."},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"The request as below::"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    The request:"}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_7ef693d8","line":62,"in_reply_to":"7a77a97e_d6596490","updated":"2016-11-15 05:52:23.000000000","message":"Same as above","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"06a146e71ebe75fce4c9addd825d69b7346634df","unresolved":false,"context_lines":[{"line_number":77,"context_line":"corresponding JSON-schema as below::"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    {"},{"line_number":80,"context_line":"        type\u0027: \u0027object\u0027,"},{"line_number":81,"context_line":"        \u0027properties\u0027: {"},{"line_number":82,"context_line":"            \u0027name\u0027: {\u0027type\u0027: \u0027string\u0027, \u0027format\u0027: \u0027regex\u0027},"},{"line_number":83,"context_line":"            \u0027sort_key\u0027: {\u0027oneOf\u0027: ["}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_f6a3c04d","line":80,"range":{"start_line":80,"start_character":8,"end_line":80,"end_character":13},"updated":"2016-11-14 18:34:35.000000000","message":"\u0027type\u0027 - missing the first \u0027\n\n-1 for this","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"4b38f8b32f669ef72543b3fa648c2825ad4ec98e","unresolved":false,"context_lines":[{"line_number":77,"context_line":"corresponding JSON-schema as below::"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    {"},{"line_number":80,"context_line":"        type\u0027: \u0027object\u0027,"},{"line_number":81,"context_line":"        \u0027properties\u0027: {"},{"line_number":82,"context_line":"            \u0027name\u0027: {\u0027type\u0027: \u0027string\u0027, \u0027format\u0027: \u0027regex\u0027},"},{"line_number":83,"context_line":"            \u0027sort_key\u0027: {\u0027oneOf\u0027: ["}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_be002bac","line":80,"range":{"start_line":80,"start_character":8,"end_line":80,"end_character":13},"in_reply_to":"7a77a97e_f6a3c04d","updated":"2016-11-15 05:52:23.000000000","message":"oops","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"06a146e71ebe75fce4c9addd825d69b7346634df","unresolved":false,"context_lines":[{"line_number":106,"context_line":"The value of `sort_key` can pass the validation, it can be single value or"},{"line_number":107,"context_line":"multiple values."},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"For support the multiple values, like the `sort_key` parameter, we have to"},{"line_number":110,"context_line":"use `oneOf` in the json-schema. For reducing the copy/paste, a macro function"},{"line_number":111,"context_line":"is introduced::"},{"line_number":112,"context_line":""}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_365b7856","line":109,"range":{"start_line":109,"start_character":0,"end_line":109,"end_character":3},"updated":"2016-11-14 18:34:35.000000000","message":"s/For/To/","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"4b38f8b32f669ef72543b3fa648c2825ad4ec98e","unresolved":false,"context_lines":[{"line_number":106,"context_line":"The value of `sort_key` can pass the validation, it can be single value or"},{"line_number":107,"context_line":"multiple values."},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"For support the multiple values, like the `sort_key` parameter, we have to"},{"line_number":110,"context_line":"use `oneOf` in the json-schema. For reducing the copy/paste, a macro function"},{"line_number":111,"context_line":"is introduced::"},{"line_number":112,"context_line":""}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_be174bec","line":109,"range":{"start_line":109,"start_character":0,"end_line":109,"end_character":3},"in_reply_to":"7a77a97e_365b7856","updated":"2016-11-15 05:52:23.000000000","message":"Done","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"06a146e71ebe75fce4c9addd825d69b7346634df","unresolved":false,"context_lines":[{"line_number":132,"context_line":"        {\u0027type\u0027: \u0027string\u0027, \u0027enum\u0027: [\u0027created_at\u0027, \u0027updated_at\u0027]}"},{"line_number":133,"context_line":"    ]},"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"The schema will be attched to each API by an new decorator::"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    @validation.query_params_schema(schema, min_version, max_version)"},{"line_number":138,"context_line":""}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_d63a44e7","line":135,"range":{"start_line":135,"start_character":19,"end_line":135,"end_character":26},"updated":"2016-11-14 18:34:35.000000000","message":"attached","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"4b38f8b32f669ef72543b3fa648c2825ad4ec98e","unresolved":false,"context_lines":[{"line_number":132,"context_line":"        {\u0027type\u0027: \u0027string\u0027, \u0027enum\u0027: [\u0027created_at\u0027, \u0027updated_at\u0027]}"},{"line_number":133,"context_line":"    ]},"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"The schema will be attched to each API by an new decorator::"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    @validation.query_params_schema(schema, min_version, max_version)"},{"line_number":138,"context_line":""}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_ded24734","line":135,"range":{"start_line":135,"start_character":19,"end_line":135,"end_character":26},"in_reply_to":"7a77a97e_d63a44e7","updated":"2016-11-15 05:52:23.000000000","message":"Done","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"06a146e71ebe75fce4c9addd825d69b7346634df","unresolved":false,"context_lines":[{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    @validation.query_params_schema(schema, min_version, max_version)"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"The microversion which the json-schema against to can be specified in the"},{"line_number":140,"context_line":"decorator. The usage of decorator is same with the body jsons-schema decorator."},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"This proposal will use the keypairs API as example. For using the json-schema"}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_b903fb0c","line":139,"range":{"start_line":139,"start_character":39,"end_line":139,"end_character":56},"updated":"2016-11-14 18:34:35.000000000","message":"This doesn\u0027t read correctly. I think what you mean to say is:\n\n\"The supported microversion range for a given json-schema can be specified in the decorator.\"","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"4b38f8b32f669ef72543b3fa648c2825ad4ec98e","unresolved":false,"context_lines":[{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    @validation.query_params_schema(schema, min_version, max_version)"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"The microversion which the json-schema against to can be specified in the"},{"line_number":140,"context_line":"decorator. The usage of decorator is same with the body jsons-schema decorator."},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"This proposal will use the keypairs API as example. For using the json-schema"}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_beee6bea","line":139,"range":{"start_line":139,"start_character":39,"end_line":139,"end_character":56},"in_reply_to":"7a77a97e_b903fb0c","updated":"2016-11-15 05:52:23.000000000","message":"sorry about that :(","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"06a146e71ebe75fce4c9addd825d69b7346634df","unresolved":false,"context_lines":[{"line_number":142,"context_line":"This proposal will use the keypairs API as example. For using the json-schema"},{"line_number":143,"context_line":"to validate query parameters for other APIs will be in other proposal."},{"line_number":144,"context_line":""},{"line_number":145,"context_line":"In the keypairs API,new query parameters were added in Microversion 2.10"},{"line_number":146,"context_line":"and 2.35. For example, the decorator will be added for index method as below::"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    schema_v2_1 \u003d {"}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_d908b72b","line":145,"range":{"start_line":145,"start_character":16,"end_line":145,"end_character":23},"updated":"2016-11-14 18:34:35.000000000","message":"s/API,new/API, new/","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"06a146e71ebe75fce4c9addd825d69b7346634df","unresolved":false,"context_lines":[{"line_number":152,"context_line":"    }"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    schema_v2_10 \u003d copy.deepcopy(schema_v2_1)"},{"line_number":155,"context_line":"    schema_v2_10[\u0027properties\u0027] \u003d {\u0027user_id\u0027: multi_params({\u0027type\u0027: \u0027string\u0027}}"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    schema_v2_35 \u003d copy.deepcopy(schema_v2_10)"},{"line_number":158,"context_line":"    schema_v2_35[\u0027properties\u0027][\u0027limit\u0027] \u003d multi_params("}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_1995cf3f","line":155,"range":{"start_line":155,"start_character":45,"end_line":155,"end_character":57},"updated":"2016-11-14 18:34:35.000000000","message":"I guess we allow specifying more than one but we only pick the first one:\n\nhttps://github.com/openstack/nova/blob/00bc0cb53d6113fae9a7714386953d1d75db71c1/nova/api/openstack/compute/keypairs.py#L187\n\nrestricting to one user_id would be a backward incompatible change though I guess...","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"4b38f8b32f669ef72543b3fa648c2825ad4ec98e","unresolved":false,"context_lines":[{"line_number":152,"context_line":"    }"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    schema_v2_10 \u003d copy.deepcopy(schema_v2_1)"},{"line_number":155,"context_line":"    schema_v2_10[\u0027properties\u0027] \u003d {\u0027user_id\u0027: multi_params({\u0027type\u0027: \u0027string\u0027}}"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    schema_v2_35 \u003d copy.deepcopy(schema_v2_10)"},{"line_number":158,"context_line":"    schema_v2_35[\u0027properties\u0027][\u0027limit\u0027] \u003d multi_params("}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_bec58b5c","line":155,"range":{"start_line":155,"start_character":45,"end_line":155,"end_character":57},"in_reply_to":"7a77a97e_1995cf3f","updated":"2016-11-15 05:52:23.000000000","message":"yes","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"06a146e71ebe75fce4c9addd825d69b7346634df","unresolved":false,"context_lines":[{"line_number":170,"context_line":"When the value of `additionalProperties` is `False` means the extra query"},{"line_number":171,"context_line":"aren\u0027t allowed."},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"The value of `additionalProperties` will be `True` until we decide to strict"},{"line_number":174,"context_line":"the parameters in the future, and it will be changed with new microversion. For"},{"line_number":175,"context_line":"now we still need to enable the any random input in the query string. But the"},{"line_number":176,"context_line":"extra parameters will be stripped out for protecting the system. Also for"}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_f99d735a","line":173,"range":{"start_line":173,"start_character":70,"end_line":173,"end_character":76},"updated":"2016-11-14 18:34:35.000000000","message":"restrict","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"06a146e71ebe75fce4c9addd825d69b7346634df","unresolved":false,"context_lines":[{"line_number":172,"context_line":""},{"line_number":173,"context_line":"The value of `additionalProperties` will be `True` until we decide to strict"},{"line_number":174,"context_line":"the parameters in the future, and it will be changed with new microversion. For"},{"line_number":175,"context_line":"now we still need to enable the any random input in the query string. But the"},{"line_number":176,"context_line":"extra parameters will be stripped out for protecting the system. Also for"},{"line_number":177,"context_line":"matching the current behaviour, we need to enable multiple values for all the"},{"line_number":178,"context_line":"parameters(using the macro function \u0027multi_params\u0027 to extract the schema for"}],"source_content_type":"text/x-rst","patch_set":8,"id":"7a77a97e_59ad8787","line":175,"range":{"start_line":175,"start_character":28,"end_line":175,"end_character":31},"updated":"2016-11-14 18:34:35.000000000","message":"s/the//","commit_id":"8f1f4303de5a00260f29296bc0901227764bc22b"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"93573ea7b93e8f113140c2d0ff25300899b05a33","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"The API layer supports validating the input body with json-schema, and"},{"line_number":22,"context_line":"there are a set of mechanisms to support microversion. But no control on those"},{"line_number":23,"context_line":"query parameters, leading to we have a set of problem."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"* Inconsistent query parameter validation in the API method. The similar query"},{"line_number":26,"context_line":"  parameter have different validation. Or some query parameters are without any"}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_e2aae4d3","line":23,"updated":"2016-11-15 18:02:31.000000000","message":"Try: The API layer supports validating the input body of a request with json-schema. There are mechanisms to support microversions of the schemas. There is no centralized support, however, for validating query parameters leading to inconsistent handling.","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"95c0f7466f6f7dc0ecfe8dd75135437a405563ea","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"The API layer supports validating the input body with json-schema, and"},{"line_number":22,"context_line":"there are a set of mechanisms to support microversion. But no control on those"},{"line_number":23,"context_line":"query parameters, leading to we have a set of problem."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"* Inconsistent query parameter validation in the API method. The similar query"},{"line_number":26,"context_line":"  parameter have different validation. Or some query parameters are without any"}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_28baecc0","line":23,"in_reply_to":"7a77a97e_e2aae4d3","updated":"2016-11-16 04:48:51.000000000","message":"thanks","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"93573ea7b93e8f113140c2d0ff25300899b05a33","unresolved":false,"context_lines":[{"line_number":24,"context_line":""},{"line_number":25,"context_line":"* Inconsistent query parameter validation in the API method. The similar query"},{"line_number":26,"context_line":"  parameter have different validation. Or some query parameters are without any"},{"line_number":27,"context_line":"  validation. For example, there are parameters accept different datetime"},{"line_number":28,"context_line":"  format between servers list API and simple_tenant_usage API. The"},{"line_number":29,"context_line":"  `changes-since` in the server list accepts datetime with `ISO 8601 format`"},{"line_number":30,"context_line":"  [1]. The `start`/`end` in the simple_tenant_usage accepts some custom"}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_02c5208d","line":27,"updated":"2016-11-15 18:02:31.000000000","message":"there are parameters _that_ accept different datetime","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"95c0f7466f6f7dc0ecfe8dd75135437a405563ea","unresolved":false,"context_lines":[{"line_number":24,"context_line":""},{"line_number":25,"context_line":"* Inconsistent query parameter validation in the API method. The similar query"},{"line_number":26,"context_line":"  parameter have different validation. Or some query parameters are without any"},{"line_number":27,"context_line":"  validation. For example, there are parameters accept different datetime"},{"line_number":28,"context_line":"  format between servers list API and simple_tenant_usage API. The"},{"line_number":29,"context_line":"  `changes-since` in the server list accepts datetime with `ISO 8601 format`"},{"line_number":30,"context_line":"  [1]. The `start`/`end` in the simple_tenant_usage accepts some custom"}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_e8c0f42c","line":27,"in_reply_to":"7a77a97e_02c5208d","updated":"2016-11-16 04:48:51.000000000","message":"Done","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"51b3ff960e5f850c70daa3a22dff58816085be16","unresolved":false,"context_lines":[{"line_number":30,"context_line":"  [1]. The `start`/`end` in the simple_tenant_usage accepts some custom"},{"line_number":31,"context_line":"  format [2]."},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"* Without looking deep into the code, the developer can\u0027t know which query"},{"line_number":34,"context_line":"  parameters are supported by the API. And there are some query parameters that"},{"line_number":35,"context_line":"  are just pass into the SQL query directly. For example, the value of"},{"line_number":36,"context_line":"  `sort_key` for the server list API are pass into the DB layer directly.[3]"}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_9bfeec36","line":33,"range":{"start_line":33,"start_character":42,"end_line":33,"end_character":51},"updated":"2016-11-16 05:49:07.000000000","message":"s/the developer/developers and users/","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"93573ea7b93e8f113140c2d0ff25300899b05a33","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"* Without looking deep into the code, the developer can\u0027t know which query"},{"line_number":34,"context_line":"  parameters are supported by the API. And there are some query parameters that"},{"line_number":35,"context_line":"  are just pass into the SQL query directly. For example, the value of"},{"line_number":36,"context_line":"  `sort_key` for the server list API are pass into the DB layer directly.[3]"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"* The DB schema expose to the REST API directly. When the DB schema change,"}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_a23c6c94","line":35,"updated":"2016-11-15 18:02:31.000000000","message":"s/just pass/passed/","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"95c0f7466f6f7dc0ecfe8dd75135437a405563ea","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"* Without looking deep into the code, the developer can\u0027t know which query"},{"line_number":34,"context_line":"  parameters are supported by the API. And there are some query parameters that"},{"line_number":35,"context_line":"  are just pass into the SQL query directly. For example, the value of"},{"line_number":36,"context_line":"  `sort_key` for the server list API are pass into the DB layer directly.[3]"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"* The DB schema expose to the REST API directly. When the DB schema change,"}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_68eb04b1","line":35,"in_reply_to":"7a77a97e_a23c6c94","updated":"2016-11-16 04:48:51.000000000","message":"Done","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"51b3ff960e5f850c70daa3a22dff58816085be16","unresolved":false,"context_lines":[{"line_number":38,"context_line":"* The DB schema expose to the REST API directly. When the DB schema change,"},{"line_number":39,"context_line":"  the API will be changed also. The same example as above. The value of"},{"line_number":40,"context_line":"  `sort_key` passed to the DB layer directly, it leads to the internal"},{"line_number":41,"context_line":"  attribute `__wrapper__` of DB object expose to the REST API."},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"Use Cases"},{"line_number":44,"context_line":"---------"}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_1b99fc1f","line":41,"updated":"2016-11-16 05:49:07.000000000","message":"The above description seems great for me, well explanation.\nThis seems a big problem for us.","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"93573ea7b93e8f113140c2d0ff25300899b05a33","unresolved":false,"context_lines":[{"line_number":44,"context_line":"---------"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"This is an effort about the refactor of the API layer code. It aims to ease the"},{"line_number":47,"context_line":"burden of maintaining API code. The use-cases are for the developers:"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"* The developers needs a consistent validation for the query parameters."},{"line_number":50,"context_line":"* The developers don\u0027t want to mix the validation code with the other API code"}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_c25888fd","line":47,"updated":"2016-11-15 18:02:31.000000000","message":"developers of nova\n\n(to distinguish from developers using nova)","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"95c0f7466f6f7dc0ecfe8dd75135437a405563ea","unresolved":false,"context_lines":[{"line_number":44,"context_line":"---------"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"This is an effort about the refactor of the API layer code. It aims to ease the"},{"line_number":47,"context_line":"burden of maintaining API code. The use-cases are for the developers:"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"* The developers needs a consistent validation for the query parameters."},{"line_number":50,"context_line":"* The developers don\u0027t want to mix the validation code with the other API code"}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_88d220ff","line":47,"in_reply_to":"7a77a97e_c25888fd","updated":"2016-11-16 04:48:51.000000000","message":"good point","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"93573ea7b93e8f113140c2d0ff25300899b05a33","unresolved":false,"context_lines":[{"line_number":46,"context_line":"This is an effort about the refactor of the API layer code. It aims to ease the"},{"line_number":47,"context_line":"burden of maintaining API code. The use-cases are for the developers:"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"* The developers needs a consistent validation for the query parameters."},{"line_number":50,"context_line":"* The developers don\u0027t want to mix the validation code with the other API code"},{"line_number":51,"context_line":"  together."},{"line_number":52,"context_line":"* The developers needs a central place to declare the supported query"}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_e25d84ea","line":49,"updated":"2016-11-15 18:02:31.000000000","message":"need","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"95c0f7466f6f7dc0ecfe8dd75135437a405563ea","unresolved":false,"context_lines":[{"line_number":46,"context_line":"This is an effort about the refactor of the API layer code. It aims to ease the"},{"line_number":47,"context_line":"burden of maintaining API code. The use-cases are for the developers:"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"* The developers needs a consistent validation for the query parameters."},{"line_number":50,"context_line":"* The developers don\u0027t want to mix the validation code with the other API code"},{"line_number":51,"context_line":"  together."},{"line_number":52,"context_line":"* The developers needs a central place to declare the supported query"}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_a8cd1c5f","line":49,"in_reply_to":"7a77a97e_e25d84ea","updated":"2016-11-16 04:48:51.000000000","message":"Done","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"93573ea7b93e8f113140c2d0ff25300899b05a33","unresolved":false,"context_lines":[{"line_number":49,"context_line":"* The developers needs a consistent validation for the query parameters."},{"line_number":50,"context_line":"* The developers don\u0027t want to mix the validation code with the other API code"},{"line_number":51,"context_line":"  together."},{"line_number":52,"context_line":"* The developers needs a central place to declare the supported query"},{"line_number":53,"context_line":"  parameters."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"Finially the end-user will get benefits as below:"}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_426d5897","line":52,"updated":"2016-11-15 18:02:31.000000000","message":"need","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"95c0f7466f6f7dc0ecfe8dd75135437a405563ea","unresolved":false,"context_lines":[{"line_number":49,"context_line":"* The developers needs a consistent validation for the query parameters."},{"line_number":50,"context_line":"* The developers don\u0027t want to mix the validation code with the other API code"},{"line_number":51,"context_line":"  together."},{"line_number":52,"context_line":"* The developers needs a central place to declare the supported query"},{"line_number":53,"context_line":"  parameters."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"Finially the end-user will get benefits as below:"}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_c8dc1815","line":52,"in_reply_to":"7a77a97e_426d5897","updated":"2016-11-16 04:48:51.000000000","message":"Done","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"51b3ff960e5f850c70daa3a22dff58816085be16","unresolved":false,"context_lines":[{"line_number":51,"context_line":"  together."},{"line_number":52,"context_line":"* The developers needs a central place to declare the supported query"},{"line_number":53,"context_line":"  parameters."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"Finially the end-user will get benefits as below:"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"* Consistent query parameter validation."}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_5b3ff4d5","line":54,"updated":"2016-11-16 05:49:07.000000000","message":"One more merit/use case is that we can use this JSON-Schema definition for fixing our api-ref docs also based on concrete resource we can believe strongly.","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"93573ea7b93e8f113140c2d0ff25300899b05a33","unresolved":false,"context_lines":[{"line_number":52,"context_line":"* The developers needs a central place to declare the supported query"},{"line_number":53,"context_line":"  parameters."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"Finially the end-user will get benefits as below:"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"* Consistent query parameter validation."},{"line_number":58,"context_line":"* Stable API, the API won\u0027t be changed by under-layer DB schema change anymore."}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_8205b0c3","line":55,"updated":"2016-11-15 18:02:31.000000000","message":"Finally","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"95c0f7466f6f7dc0ecfe8dd75135437a405563ea","unresolved":false,"context_lines":[{"line_number":52,"context_line":"* The developers needs a central place to declare the supported query"},{"line_number":53,"context_line":"  parameters."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"Finially the end-user will get benefits as below:"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"* Consistent query parameter validation."},{"line_number":58,"context_line":"* Stable API, the API won\u0027t be changed by under-layer DB schema change anymore."}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_08053079","line":55,"in_reply_to":"7a77a97e_8205b0c3","updated":"2016-11-16 04:48:51.000000000","message":"Done","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"202e75e785168c30f32c1acc8190d6a2b4d8ae63","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"The JSON-schema is a familiar tool for the developers also, so it\u0027s good to"},{"line_number":67,"context_line":"build new mechanism based on that."},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"For using JSON-schema to validate the query parameters, it needs to convert"},{"line_number":70,"context_line":"the query parameters to a flat JSON data. For example, there are three"},{"line_number":71,"context_line":"query parameters:"}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_7eb01e44","line":68,"updated":"2016-11-16 05:58:52.000000000","message":"This spec doesn\u0027t mention error status code(HTTP400?).\nThat should be written clearly.","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"c049558b685e42b1ab9257159d112530f5aee633","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"The JSON-schema is a familiar tool for the developers also, so it\u0027s good to"},{"line_number":67,"context_line":"build new mechanism based on that."},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"For using JSON-schema to validate the query parameters, it needs to convert"},{"line_number":70,"context_line":"the query parameters to a flat JSON data. For example, there are three"},{"line_number":71,"context_line":"query parameters:"}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_7e21fe4c","line":68,"in_reply_to":"7a77a97e_7eb01e44","updated":"2016-11-16 06:06:37.000000000","message":"ah, yea","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"93573ea7b93e8f113140c2d0ff25300899b05a33","unresolved":false,"context_lines":[{"line_number":78,"context_line":"The request as below::"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    The request:"},{"line_number":81,"context_line":"     GET http://openstack.example.com/v2.1/servers?name\u003dabc\u0026sort_key\u003dcreated_at\u0026sork_key\u003dupdated_at\u0026deleted\u003dTrue"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"The query parameters convert to a flat JSON data::"},{"line_number":84,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_e214a4f6","line":81,"updated":"2016-11-15 18:02:31.000000000","message":"Do you mean \u0027sork_key\u0027 here (as a demo of a bad parameter) or is that a typo?","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"95c0f7466f6f7dc0ecfe8dd75135437a405563ea","unresolved":false,"context_lines":[{"line_number":78,"context_line":"The request as below::"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    The request:"},{"line_number":81,"context_line":"     GET http://openstack.example.com/v2.1/servers?name\u003dabc\u0026sort_key\u003dcreated_at\u0026sork_key\u003dupdated_at\u0026deleted\u003dTrue"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"The query parameters convert to a flat JSON data::"},{"line_number":84,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_88f94083","line":81,"in_reply_to":"7a77a97e_e214a4f6","updated":"2016-11-16 04:48:51.000000000","message":"it is typo, it should be \u0027sort_key\u0027","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"93573ea7b93e8f113140c2d0ff25300899b05a33","unresolved":false,"context_lines":[{"line_number":110,"context_line":"    }"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"If there are multiple values for `name` and only single value for `sort_key`"},{"line_number":113,"context_line":"in the request, those parameters will be converted to::"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    {"},{"line_number":116,"context_line":"        \u0027name\u0027: [\u0027^abc\u0027, \u0027^xyz\u0027],"}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_0296004c","line":113,"updated":"2016-11-15 18:02:31.000000000","message":"As I mentioned in my comments on the POC code I think that having a data structure that switches back and forth between list and not list is problematic. Would be better to have just list. This is how urlparse.parse_qs works.\n\nYes, it can be annoying for single values but it makes code consistent.","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"22186246b727c5a91c06c4376f56043240c204f2","unresolved":false,"context_lines":[{"line_number":110,"context_line":"    }"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"If there are multiple values for `name` and only single value for `sort_key`"},{"line_number":113,"context_line":"in the request, those parameters will be converted to::"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    {"},{"line_number":116,"context_line":"        \u0027name\u0027: [\u0027^abc\u0027, \u0027^xyz\u0027],"}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_166e2301","line":113,"in_reply_to":"7a77a97e_01725ead","updated":"2016-11-16 11:46:52.000000000","message":"Emm...I think this is related how we write the json-schema. If we only use \u0027list\u0027, then we can write schema for single value as  {\u0027type\u0027: \u0027array\u0027, {\u0027type\u0027: \u0027string\u0027}, \u0027maxItems\u0027: 1}. For multiple values, just need to remove the \u0027maxItems\u0027. Then we needn\u0027t use the \u0027oneOf\u0027 anymore. This looks like more simple.","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"98ca7e41298683bb0e16ebd542daf48e7d5ec365","unresolved":false,"context_lines":[{"line_number":110,"context_line":"    }"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"If there are multiple values for `name` and only single value for `sort_key`"},{"line_number":113,"context_line":"in the request, those parameters will be converted to::"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    {"},{"line_number":116,"context_line":"        \u0027name\u0027: [\u0027^abc\u0027, \u0027^xyz\u0027],"}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_0f625d3e","line":113,"in_reply_to":"7a77a97e_01725ead","updated":"2016-11-17 02:51:10.000000000","message":"One issue with starting to return a 400 on multiple items when we only accept one is that\u0027s a backward incompatible change unless we microversion it - today we just pick the first item and go with it. Mentioned that a bit in PS8.","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"95c0f7466f6f7dc0ecfe8dd75135437a405563ea","unresolved":false,"context_lines":[{"line_number":110,"context_line":"    }"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"If there are multiple values for `name` and only single value for `sort_key`"},{"line_number":113,"context_line":"in the request, those parameters will be converted to::"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    {"},{"line_number":116,"context_line":"        \u0027name\u0027: [\u0027^abc\u0027, \u0027^xyz\u0027],"}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_a850bc5f","line":113,"in_reply_to":"7a77a97e_0296004c","updated":"2016-11-16 04:48:51.000000000","message":"@Chris, Is there any discussion about whether worth to return 400 when multiple values specified for single value parameter?\n\nIf all of those parameters are going to just list, then we can\u0027t validate that case. Just like at line 97, if there are multiple \u0027name\u0027 parameter specified, the validation will fail and return 400.","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"6fbd007671405a0acd79e34e991dcd3936769652","unresolved":false,"context_lines":[{"line_number":110,"context_line":"    }"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"If there are multiple values for `name` and only single value for `sort_key`"},{"line_number":113,"context_line":"in the request, those parameters will be converted to::"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    {"},{"line_number":116,"context_line":"        \u0027name\u0027: [\u0027^abc\u0027, \u0027^xyz\u0027],"}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_01725ead","line":113,"in_reply_to":"7a77a97e_a850bc5f","updated":"2016-11-16 10:51:28.000000000","message":"In this context, the point is to be strictly validating, thus I would think 400 would be the right choice when sending multiple values for something that is supposed to only have one. I think that\u0027s the right thing to do and the json-schema should represent. My comments about the data structure are more to do with the implementation (not the goal) so will comment more about the data structure on the POC code.","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"d86b80fcfc93906f68415d7da692816f8bac8bb3","unresolved":false,"context_lines":[{"line_number":176,"context_line":"    schema_v2_35[\u0027properties\u0027][\u0027marker\u0027] \u003d multi_params({\u0027type\u0027: \u0027string\u0027})"},{"line_number":177,"context_line":"    @validation.query_params_schema(schema_v2_35, \u00272.35\u0027)"},{"line_number":178,"context_line":"    @validation.query_params_schema(schema_v2_10, \u00272.10\u0027, \u00272.34\u0027)"},{"line_number":179,"context_line":"    @validation.query_params_schema(schema_v2_1, \u00272.1\u0027, \u00272.9)"},{"line_number":180,"context_line":"    def index(req):"},{"line_number":181,"context_line":"        ...."},{"line_number":182,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_fe88ae24","line":179,"range":{"start_line":179,"start_character":4,"end_line":179,"end_character":61},"updated":"2016-11-16 06:08:06.000000000","message":"There should be:\n\n@validation.query_params_schema(schema_v2_1, \u00272.0\u0027, \u00272.9\u0027)\n\nThen the legacy v2 API mode will get the protection also.","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"51b3ff960e5f850c70daa3a22dff58816085be16","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        ...."},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"When the value of `additionalProperties` is `True` means the extra query"},{"line_number":184,"context_line":"parameters are allowed. But those extra query parameters will be stripped out."},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"When the value of `additionalProperties` is `False` means the extra query"},{"line_number":187,"context_line":"aren\u0027t allowed."}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_fb636018","line":184,"range":{"start_line":184,"start_character":65,"end_line":184,"end_character":78},"updated":"2016-11-16 05:49:07.000000000","message":"or \"just ignored\"","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"c049558b685e42b1ab9257159d112530f5aee633","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        ...."},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"When the value of `additionalProperties` is `True` means the extra query"},{"line_number":184,"context_line":"parameters are allowed. But those extra query parameters will be stripped out."},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"When the value of `additionalProperties` is `False` means the extra query"},{"line_number":187,"context_line":"aren\u0027t allowed."}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_7ec57e8c","line":184,"range":{"start_line":184,"start_character":65,"end_line":184,"end_character":78},"in_reply_to":"7a77a97e_fb636018","updated":"2016-11-16 06:06:37.000000000","message":"Done","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"51b3ff960e5f850c70daa3a22dff58816085be16","unresolved":false,"context_lines":[{"line_number":192,"context_line":"extra parameters will be stripped out for protecting the system. Also for"},{"line_number":193,"context_line":"matching the current behaviour, we need to enable multiple values for all the"},{"line_number":194,"context_line":"parameters(using the macro function \u0027multi_params\u0027 to extract the schema for"},{"line_number":195,"context_line":"multiple values). This also works for legacy v2 model of Nova v2.1 API, the"},{"line_number":196,"context_line":"legacy v2 model get the protection and back-compatibility."},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"Alternatives"},{"line_number":199,"context_line":"------------"}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_db7dc4b2","line":196,"range":{"start_line":195,"start_character":18,"end_line":196,"end_character":58},"updated":"2016-11-16 05:49:07.000000000","message":"Maybe this wants to say \"additionalProperties should work as True always on legacy v2 mode.\", right?\n\nIf so, I agree with that.","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"c049558b685e42b1ab9257159d112530f5aee633","unresolved":false,"context_lines":[{"line_number":192,"context_line":"extra parameters will be stripped out for protecting the system. Also for"},{"line_number":193,"context_line":"matching the current behaviour, we need to enable multiple values for all the"},{"line_number":194,"context_line":"parameters(using the macro function \u0027multi_params\u0027 to extract the schema for"},{"line_number":195,"context_line":"multiple values). This also works for legacy v2 model of Nova v2.1 API, the"},{"line_number":196,"context_line":"legacy v2 model get the protection and back-compatibility."},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"Alternatives"},{"line_number":199,"context_line":"------------"}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_fe2c2e4c","line":196,"range":{"start_line":195,"start_character":18,"end_line":196,"end_character":58},"in_reply_to":"7a77a97e_db7dc4b2","updated":"2016-11-16 06:06:37.000000000","message":"emm...I thought we should explicitly. So I should fix line 179, it should be:\n\n@validation.query_params_schema(schema_v2_1, \u00272.0\u0027, \u00272.9\u0027)","commit_id":"794f56f98b8954f766485057ab7307ac66c61d9a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"51f6d4f85f1331b60243cae422713990bfcb9a36","unresolved":false,"context_lines":[{"line_number":198,"context_line":"will be validated. The new validation mechanism supports multiple value"},{"line_number":199,"context_line":"parameters. The difference is that the new mechanism will validate all the"},{"line_number":200,"context_line":"values even only one accepted. But thinking of this is rare case, so the"},{"line_number":201,"context_line":"difference is acceptable."},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"Security impact"},{"line_number":204,"context_line":"---------------"}],"source_content_type":"text/x-rst","patch_set":11,"id":"7a77a97e_a22fe2f4","line":201,"updated":"2016-11-16 13:41:33.000000000","message":"I feel this should focus on the key pairs changes, and describe them separate to the framework in proposed changes.\n\non the mess with multiples:\n\nuser_id\u003d**invalid stuff**\n\n* should raise 400 error, to protect the system\n\nuser_id\u003d1,user_id\u003d2\n\n* Past: accept, but we ignore user_id\u003d2\n* Now: accept, but we ignore user_id\u003d2\n* Future, when we add a micro version, it should be a 400 error\n\nuser_id\u003d1,user_id\u003d**invalid stuff**\n\n* Past: this would be accepted\n* Now: raise 400 error, as we validate all params","commit_id":"55cfb5662e3f8fb2625d328be989a0463a39015a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"0565c780771e4da56059eadef7196ac3500ef9cd","unresolved":false,"context_lines":[{"line_number":198,"context_line":"will be validated. The new validation mechanism supports multiple value"},{"line_number":199,"context_line":"parameters. The difference is that the new mechanism will validate all the"},{"line_number":200,"context_line":"values even only one accepted. But thinking of this is rare case, so the"},{"line_number":201,"context_line":"difference is acceptable."},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"Security impact"},{"line_number":204,"context_line":"---------------"}],"source_content_type":"text/x-rst","patch_set":11,"id":"7a77a97e_a2f2826d","line":201,"updated":"2016-11-16 13:40:39.000000000","message":"I will add real world example at here.","commit_id":"55cfb5662e3f8fb2625d328be989a0463a39015a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"beff67fe2c5955736d6f8e9162725029842950ea","unresolved":false,"context_lines":[{"line_number":198,"context_line":"will be validated. The new validation mechanism supports multiple value"},{"line_number":199,"context_line":"parameters. The difference is that the new mechanism will validate all the"},{"line_number":200,"context_line":"values even only one accepted. But thinking of this is rare case, so the"},{"line_number":201,"context_line":"difference is acceptable."},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"Security impact"},{"line_number":204,"context_line":"---------------"}],"source_content_type":"text/x-rst","patch_set":11,"id":"7a77a97e_88ea070e","line":201,"in_reply_to":"7a77a97e_a22fe2f4","updated":"2016-11-16 14:08:59.000000000","message":"The problem with keypairs is that there is no validation for the user_id currently. So it\u0027s hard to show the last case.","commit_id":"55cfb5662e3f8fb2625d328be989a0463a39015a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"41c82ec04ec3887fbce5626223415f45075c7933","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"* Without looking deep into the code, the developers and users can\u0027t know which"},{"line_number":35,"context_line":"  query parameters are supported by the API. And there are some query"},{"line_number":36,"context_line":"  parameters that are just passd into the SQL query directly. For example, the"},{"line_number":37,"context_line":"  value of `sort_key` for the server list API are pass into the DB layer"},{"line_number":38,"context_line":"  directly.[3]"},{"line_number":39,"context_line":""}],"source_content_type":"text/x-rst","patch_set":13,"id":"7a77a97e_cf2dc5a9","line":36,"range":{"start_line":36,"start_character":27,"end_line":36,"end_character":32},"updated":"2016-11-17 03:05:06.000000000","message":"passed","commit_id":"5ce44dad9922771be19c64828ad16e2df682ee01"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"41c82ec04ec3887fbce5626223415f45075c7933","unresolved":false,"context_lines":[{"line_number":37,"context_line":"  value of `sort_key` for the server list API are pass into the DB layer"},{"line_number":38,"context_line":"  directly.[3]"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"* The DB schema expose to the REST API directly. When the DB schema change,"},{"line_number":41,"context_line":"  the API will be changed also. The same example as above. The value of"},{"line_number":42,"context_line":"  `sort_key` passed to the DB layer directly, it leads to the internal"},{"line_number":43,"context_line":"  attribute `__wrapper__` of DB object expose to the REST API."},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"Use Cases"},{"line_number":46,"context_line":"---------"}],"source_content_type":"text/x-rst","patch_set":13,"id":"7a77a97e_fa188177","line":43,"range":{"start_line":40,"start_character":2,"end_line":43,"end_character":62},"updated":"2016-11-17 03:05:06.000000000","message":"I can\u0027t say I\u0027m totally following this, unless this is to say that when we change the schema on the instances table, like add a column or add a related table, you can sort on that column or related table if you know about it, like instance.system_metadata.","commit_id":"5ce44dad9922771be19c64828ad16e2df682ee01"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"41c82ec04ec3887fbce5626223415f45075c7933","unresolved":false,"context_lines":[{"line_number":146,"context_line":"* When the value of `additionalProperties` is `False` means the extra query"},{"line_number":147,"context_line":"  aren\u0027t allowed."},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"The value of `additionalProperties` will be `True` until we decide to restrict"},{"line_number":150,"context_line":"the parameters in the future, and it will be changed with new microversion. For"},{"line_number":151,"context_line":"now we still need to enable the random input in the query string. But the"},{"line_number":152,"context_line":"extra parameters will be stripped out for protecting the system. Also for"},{"line_number":153,"context_line":"matching the current behaviour, we need to enable multiple values for all the"},{"line_number":154,"context_line":"parameters(using the macro function \u0027multi_params\u0027 to extract the schema for"},{"line_number":155,"context_line":"multiple values). For the legacy v2 API mode, the value of"},{"line_number":156,"context_line":"`additionalProperties` should be `True` also, it makes the legacy v2 API mode"},{"line_number":157,"context_line":"under the protection also."},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"The current API only accepts one value for single value parameter when the"},{"line_number":160,"context_line":"API user specified multiple values in the request. Only the accepted value"}],"source_content_type":"text/x-rst","patch_set":13,"id":"7a77a97e_3a891976","line":157,"range":{"start_line":149,"start_character":0,"end_line":157,"end_character":26},"updated":"2016-11-17 03:05:06.000000000","message":"In a nutshell, we won\u0027t add backward incompatible validation such that requests which used to pass will now fail (except the rare case pointed out below). That is until we add microversions to make the validation more strict. I\u0027m happy with this though.","commit_id":"5ce44dad9922771be19c64828ad16e2df682ee01"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"41c82ec04ec3887fbce5626223415f45075c7933","unresolved":false,"context_lines":[{"line_number":159,"context_line":"The current API only accepts one value for single value parameter when the"},{"line_number":160,"context_line":"API user specified multiple values in the request. Only the accepted value"},{"line_number":161,"context_line":"will be validated. The new validation mechanism supports multiple value"},{"line_number":162,"context_line":"parameters. The difference is that the new mechanism will validate all the"},{"line_number":163,"context_line":"values even only one accepted. But thinking of this is rare case, so it is"},{"line_number":164,"context_line":"acceptable."},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"Alternatives"},{"line_number":167,"context_line":"------------"}],"source_content_type":"text/x-rst","patch_set":13,"id":"7a77a97e_5a6c15d0","line":164,"range":{"start_line":162,"start_character":12,"end_line":164,"end_character":11},"updated":"2016-11-17 03:05:06.000000000","message":"So I think this is the thing John pointed out earlier where you could pass:\n\n1. user_id\u003d**invalid** - 400\n2. user_id\u003d1,user_id\u003d2 - OK, but only use user_id\u003d1\n3. user_id\u003d1,user_id\u003d**invalid** - 400\n\n#3 is new behavior, but we expect it to be rare and OK to fail on it now as it was probably a programming error on the client side anyway.\n\n\u003clater\u003e\n\nOK I see you have examples below, nice.","commit_id":"5ce44dad9922771be19c64828ad16e2df682ee01"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"41c82ec04ec3887fbce5626223415f45075c7933","unresolved":false,"context_lines":[{"line_number":205,"context_line":"The Keypairs API behaviour is as below:"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"For `GET /keypairs?user_id\u003d1\u0026user_id\u003d2`"},{"line_number":208,"context_line":"* Past: accept, but we ignore the `user_id\u003d2`"},{"line_number":209,"context_line":"* Now: accept, but we ignore `user_id\u003d2`"},{"line_number":210,"context_line":"* Future: return 400 after new microversion added"},{"line_number":211,"context_line":""}],"source_content_type":"text/x-rst","patch_set":13,"id":"7a77a97e_bac36988","line":208,"updated":"2016-11-17 03:05:06.000000000","message":"This doesn\u0027t render properly, you need a blank line before the bullet list starts. You could clean this up in a follow on patch.","commit_id":"5ce44dad9922771be19c64828ad16e2df682ee01"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"41c82ec04ec3887fbce5626223415f45075c7933","unresolved":false,"context_lines":[{"line_number":213,"context_line":"    reject, the value should be integer"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"For `GET /keypairs?limit\u003dabc\u0026limit\u003d1`"},{"line_number":216,"context_line":"* Past: accept, ignore the `limit\u003dabc`"},{"line_number":217,"context_line":"* Now: reject, all the values of `limit` should be integer"},{"line_number":218,"context_line":"* Future: reject, only single value can be specified."},{"line_number":219,"context_line":""}],"source_content_type":"text/x-rst","patch_set":13,"id":"7a77a97e_1a39bda4","line":216,"updated":"2016-11-17 03:05:06.000000000","message":"Ditto","commit_id":"5ce44dad9922771be19c64828ad16e2df682ee01"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"36d8903d1955f90f12d6559f73ed0acde4027bb8","unresolved":false,"context_lines":[{"line_number":202,"context_line":"    def index(req):"},{"line_number":203,"context_line":"        ...."},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"The Keypairs API behaviour is as below:"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"For `GET /keypairs?user_id\u003d1\u0026user_id\u003d2`"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"* Past: accept, but we ignore the `user_id\u003d2`"},{"line_number":210,"context_line":"* Now: accept, but we ignore `user_id\u003d2`"},{"line_number":211,"context_line":"* Future: return 400 after new microversion added"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"For `GET /keypairs?limit\u003dabc`"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"* Reject, the value should be integer"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"For `GET /keypairs?limit\u003dabc\u0026limit\u003d1`"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"* Past: accept, ignore the `limit\u003dabc`"},{"line_number":220,"context_line":"* Now: reject, all the values of `limit` should be integer"},{"line_number":221,"context_line":"* Future: reject, only single value can be specified."},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"Security impact"},{"line_number":224,"context_line":"---------------"}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a77a97e_5b0a577a","line":221,"range":{"start_line":205,"start_character":0,"end_line":221,"end_character":53},"updated":"2016-11-17 06:06:03.000000000","message":"This is nice and very clear.","commit_id":"405bc752b7e1986ec1dc212482260b9410c0eb1b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"c52068ee8c0ab81aa11891b643d489312d56d44f","unresolved":false,"context_lines":[{"line_number":202,"context_line":"    def index(req):"},{"line_number":203,"context_line":"        ...."},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"The Keypairs API behaviour is as below:"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"For `GET /keypairs?user_id\u003d1\u0026user_id\u003d2`"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"* Past: accept, but we ignore the `user_id\u003d2`"},{"line_number":210,"context_line":"* Now: accept, but we ignore `user_id\u003d2`"},{"line_number":211,"context_line":"* Future: return 400 after new microversion added"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"For `GET /keypairs?limit\u003dabc`"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"* Reject, the value should be integer"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"For `GET /keypairs?limit\u003dabc\u0026limit\u003d1`"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"* Past: accept, ignore the `limit\u003dabc`"},{"line_number":220,"context_line":"* Now: reject, all the values of `limit` should be integer"},{"line_number":221,"context_line":"* Future: reject, only single value can be specified."},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"Security impact"},{"line_number":224,"context_line":"---------------"}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a77a97e_bd5d157b","line":221,"range":{"start_line":205,"start_character":0,"end_line":221,"end_character":53},"in_reply_to":"7a77a97e_5b0a577a","updated":"2016-11-17 10:39:08.000000000","message":"+1, thanks for that.","commit_id":"405bc752b7e1986ec1dc212482260b9410c0eb1b"}]}
