Merge ~lloydwaltersj/maas:update-required into maas:master

Proposed by Jack Lloyd-Walters
Status: Merged
Approved by: Jack Lloyd-Walters
Approved revision: 98daadf2eafb3cc05ee3baac31f172f93d4b17f2
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~lloydwaltersj/maas:update-required
Merge into: maas:master
Diff against target: 57 lines (+7/-5)
4 files modified
src/maasserver/api/doc_oapi.py (+4/-1)
src/maasserver/api/license_keys.py (+2/-2)
src/maasserver/api/pods.py (+1/-1)
src/maasserver/management/commands/generate_oapi_spec.py (+0/-1)
Reviewer Review Type Date Requested Status
Alberto Donato (community) Approve
MAAS Lander Approve
Review via email: mp+428974@code.launchpad.net

Commit message

ensure parameters in path are required

Description of the change

A parameter found in the operation path ie: "id" in "/vm-clusters/{id}" should be marked as required.

To post a comment you must log in.
~lloydwaltersj/maas:update-required updated
1c3c727... by Jack Lloyd-Walters

remove unrelated changes

3d44377... by Jack Lloyd-Walters

add explicit checking for requirement field

Revision history for this message
Adam Collard (adam-collard) :
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b update-required lp:~lloydwaltersj/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: 1c3c727eb4ae058ca8c567eb94449f6787f32106

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b update-required lp:~lloydwaltersj/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: 3d44377d461160f2a1b0a459b91731f5b8893ec4

review: Approve
~lloydwaltersj/maas:update-required updated
98daadf... by Jack Lloyd-Walters

revert yaml.dump change

Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b update-required lp:~lloydwaltersj/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: 98daadf2eafb3cc05ee3baac31f172f93d4b17f2

review: Approve
Revision history for this message
Alberto Donato (ack) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/src/maasserver/api/doc_oapi.py b/src/maasserver/api/doc_oapi.py
index c579acd..25922cd 100644
--- a/src/maasserver/api/doc_oapi.py
+++ b/src/maasserver/api/doc_oapi.py
@@ -205,7 +205,10 @@ def _oapi_item_from_docstring(function, http_method, uri_params):
205 for param in ap_dict["params"]:205 for param in ap_dict["params"]:
206 description = _prettify(param["description_stripped"])206 description = _prettify(param["description_stripped"])
207 name = param["name"].strip("}{")207 name = param["name"].strip("}{")
208 required = param["options"]["required"].lower() == "true"208 required = (
209 param["options"]["required"].lower() == "true"
210 or name != param["name"]
211 )
209 if param["name"][0] == "{":212 if param["name"][0] == "{":
210 param_dict = {213 param_dict = {
211 "name": name,214 "name": name,
diff --git a/src/maasserver/api/license_keys.py b/src/maasserver/api/license_keys.py
index ce95254..0daec6c 100644
--- a/src/maasserver/api/license_keys.py
+++ b/src/maasserver/api/license_keys.py
@@ -165,10 +165,10 @@ class LicenseKeyHandler(OperationsHandler):
165 @description Delete license key for the given operation system and165 @description Delete license key for the given operation system and
166 distro series.166 distro series.
167167
168 @param (string) "{osystem}" [required=false] Operating system that the168 @param (string) "{osystem}" [required=true] Operating system that the
169 key belongs to.169 key belongs to.
170170
171 @param (string) "{distro_series}" [required=false] OS release that the171 @param (string) "{distro_series}" [required=true] OS release that the
172 key belongs to.172 key belongs to.
173173
174 @success (http-status-code) "server-success" 204174 @success (http-status-code) "server-success" 204
diff --git a/src/maasserver/api/pods.py b/src/maasserver/api/pods.py
index f4bfbea..8af6775 100644
--- a/src/maasserver/api/pods.py
+++ b/src/maasserver/api/pods.py
@@ -200,7 +200,7 @@ class VmHostHandler(OperationsHandler):
200 @description Performs VM host discovery and updates all discovered200 @description Performs VM host discovery and updates all discovered
201 information and discovered machines.201 information and discovered machines.
202202
203 @param (int) "{id}" [required=false] The VM host's ID.203 @param (int) "{id}" [required=true] The VM host's ID.
204204
205 @success (json) "success-json" A VM host JSON object.205 @success (json) "success-json" A VM host JSON object.
206 @success-example "success-json" [exkey=refresh-vmhost] placeholder text206 @success-example "success-json" [exkey=refresh-vmhost] placeholder text
diff --git a/src/maasserver/management/commands/generate_oapi_spec.py b/src/maasserver/management/commands/generate_oapi_spec.py
index 5299fcc..096d779 100644
--- a/src/maasserver/management/commands/generate_oapi_spec.py
+++ b/src/maasserver/management/commands/generate_oapi_spec.py
@@ -3,7 +3,6 @@
33
4"""Django command: generate the Open API specification."""4"""Django command: generate the Open API specification."""
55
6
7from django.core.management.base import BaseCommand6from django.core.management.base import BaseCommand
8import yaml7import yaml
98

Subscribers

People subscribed via source and target branches