diff options
author | hongyuzhao <zhao.hongyu@zte.com.cn> | 2019-11-27 10:49:38 +0800 |
---|---|---|
committer | hongyuzhao <zhao.hongyu@zte.com.cn> | 2019-11-27 10:55:14 +0800 |
commit | 8bd492a4918a6692d36f1e1e766c7e3a88e56084 (patch) | |
tree | 028fb66f965346be4a3d3fe8d35c825e60dacd0e /catalog/packages/serializers | |
parent | b301e35367f860fae335c85227795008b531d79b (diff) |
Swagger issue fixes from the Ericsson team
Change-Id: I4fb7609292101e9c0c44b38ec8d40657bd340460
Issue-ID: MODELING-288
Signed-off-by: hongyuzhao <zhao.hongyu@zte.com.cn>
Diffstat (limited to 'catalog/packages/serializers')
-rw-r--r-- | catalog/packages/serializers/link.py | 2 | ||||
-rw-r--r-- | catalog/packages/serializers/nsd_info.py | 6 | ||||
-rw-r--r-- | catalog/packages/serializers/nsdm_subscription.py | 7 | ||||
-rw-r--r-- | catalog/packages/serializers/pnfd_info.py | 13 | ||||
-rw-r--r-- | catalog/packages/serializers/vnf_pkg_info.py | 12 |
5 files changed, 23 insertions, 17 deletions
diff --git a/catalog/packages/serializers/link.py b/catalog/packages/serializers/link.py index a6a503c..b33ad93 100644 --- a/catalog/packages/serializers/link.py +++ b/catalog/packages/serializers/link.py @@ -15,7 +15,7 @@ from rest_framework import serializers -class LinkSerializer(serializers.Serializer): +class UriLinkSerializer(serializers.Serializer): href = serializers.CharField( help_text='URI of the referenced resource', required=True, diff --git a/catalog/packages/serializers/nsd_info.py b/catalog/packages/serializers/nsd_info.py index 9450582..7ca72be 100644 --- a/catalog/packages/serializers/nsd_info.py +++ b/catalog/packages/serializers/nsd_info.py @@ -14,16 +14,16 @@ from rest_framework import serializers from .problem_details import ProblemDetailsSerializer -from .link import LinkSerializer +from .link import UriLinkSerializer class _LinkSerializer(serializers.Serializer): - self = LinkSerializer( + self = UriLinkSerializer( help_text="URI of this resource.", required=True, allow_null=False ) - nsd_content = LinkSerializer( + nsd_content = UriLinkSerializer( help_text="Link to the NSD content resource.", required=True, allow_null=False diff --git a/catalog/packages/serializers/nsdm_subscription.py b/catalog/packages/serializers/nsdm_subscription.py index 87aa48d..140e549 100644 --- a/catalog/packages/serializers/nsdm_subscription.py +++ b/catalog/packages/serializers/nsdm_subscription.py @@ -14,17 +14,20 @@ from rest_framework import serializers -from .link import LinkSerializer +from .link import UriLinkSerializer from .subscription_auth_data import SubscriptionAuthenticationSerializer from .nsdm_filter_data import NsdmNotificationsFilter class NsdmSubscriptionLinkSerializer(serializers.Serializer): - self = LinkSerializer( + self = UriLinkSerializer( help_text="Links to resources related to this resource.", required=True ) + class Meta: + ref_name = "NSDM_SUB_LinkSerializer" + class NsdmSubscriptionSerializer(serializers.Serializer): id = serializers.CharField( diff --git a/catalog/packages/serializers/pnfd_info.py b/catalog/packages/serializers/pnfd_info.py index f9f4b6b..4502dc3 100644 --- a/catalog/packages/serializers/pnfd_info.py +++ b/catalog/packages/serializers/pnfd_info.py @@ -14,21 +14,24 @@ from rest_framework import serializers from .problem_details import ProblemDetailsSerializer -from .link import LinkSerializer +from .link import UriLinkSerializer -class _LinkSerializer(serializers.Serializer): - self = LinkSerializer( +class PnfdInfoLinksSerializer(serializers.Serializer): + self = UriLinkSerializer( help_text='URI of this resource.', required=True, allow_null=False ) - pnfd_content = LinkSerializer( + pnfd_content = UriLinkSerializer( help_text='Link to the PNFD content resource.', required=True, allow_null=False ) + class Meta: + ref_name = "PNFD_LinkSerializer" + class PnfdInfoSerializer(serializers.Serializer): id = serializers.CharField( @@ -100,7 +103,7 @@ class PnfdInfoSerializer(serializers.Serializer): required=False, allow_null=True ) - _links = _LinkSerializer( + _links = PnfdInfoLinksSerializer( help_text='Links to resources related to this resource.', required=True, allow_null=True # TODO: supposed to be False diff --git a/catalog/packages/serializers/vnf_pkg_info.py b/catalog/packages/serializers/vnf_pkg_info.py index 3fa4b17..1e3c556 100644 --- a/catalog/packages/serializers/vnf_pkg_info.py +++ b/catalog/packages/serializers/vnf_pkg_info.py @@ -16,21 +16,21 @@ from rest_framework import serializers from .checksum import ChecksumSerializer from .vnf_pkg_software_image_info import VnfPackageSoftwareImageInfoSerializer from .vnf_pkg_artifact_info import VnfPackageArtifactInfoSerializer -from .link import LinkSerializer +from .link import UriLinkSerializer -class _LinkSerializer(serializers.Serializer): - self = LinkSerializer( +class VnfPkgInfoLinkSerializer(serializers.Serializer): + self = UriLinkSerializer( help_text='URI of this resource.', required=True, allow_null=False ) - vnfd = LinkSerializer( + vnfd = UriLinkSerializer( help_text='Link to the VNFD resource.', required=False, allow_null=False ) - packageContent = LinkSerializer( + packageContent = UriLinkSerializer( help_text='Link to the "VNF package content resource.', required=True, allow_null=False @@ -120,7 +120,7 @@ class VnfPkgInfoSerializer(serializers.Serializer): required=False, allow_null=True ) - _links = _LinkSerializer( + _links = VnfPkgInfoLinkSerializer( help_text='Links to resources related to this resource.', required=True, allow_null=True # TODO supposed to be False |