diff --git a/components/schemas/dns/records/RecordIncludes.yml b/components/schemas/dns/records/RecordIncludes.yml deleted file mode 100644 index 7579469b..00000000 --- a/components/schemas/dns/records/RecordIncludes.yml +++ /dev/null @@ -1,10 +0,0 @@ -title: RecordIncludes -description: All includable resources linkable to the given records. -type: object -properties: - creators: - "$ref": "../../includes/CreatorInclude.yml" - containers: - "$ref": "../../includes/ContainersIncludes.yml" - "containers:identifiers": - $ref: ../../includes/IdentifierIncludes.yml \ No newline at end of file diff --git a/platform/paths/dns/records/includes/RecordIncludeParam.yml b/platform/paths/dns/records/includes/RecordIncludeParam.yml new file mode 100644 index 00000000..2e1d6edc --- /dev/null +++ b/platform/paths/dns/records/includes/RecordIncludeParam.yml @@ -0,0 +1,18 @@ +name: include +in: query +required: false +description: + A comma separated list of include values. Included resources will show + up under the root document's `include` field, with the key being the id of the included + resource. In the case of applying an include to a collection of resources, if two + resources share the same include, it will only appear once in the return. +schema: + type: array + items: + type: string + enum: + - creators + - containers + - containers:identifiers + - virtual-machines + - virtual-machines:identifiers \ No newline at end of file diff --git a/platform/paths/dns/records/includes/RecordIncludes.yml b/platform/paths/dns/records/includes/RecordIncludes.yml new file mode 100644 index 00000000..122aa26a --- /dev/null +++ b/platform/paths/dns/records/includes/RecordIncludes.yml @@ -0,0 +1,22 @@ +title: RecordIncludes +description: All includable resources linkable to the given records. +type: object +properties: + creators: + $ref: ../../../../../components/schemas/includes/CreatorInclude.yml + containers: + type: object + additionalProperties: + $ref: ../../../../../components/schemas/containers/Container.yml + "containers:identifiers": + type: object + additionalProperties: + $ref: ../../../../../components/schemas/ID.yml + virtual-machines: + type: object + additionalProperties: + $ref: ../../../../../components/schemas/vms/VirtualMachine.yml + virtual-machines:identifiers: + type: object + additionalProperties: + $ref: ../../../../../components/schemas/ID.yml diff --git a/platform/paths/dns/records/record.yml b/platform/paths/dns/records/record.yml index 9f2812f6..fd50c2ef 100644 --- a/platform/paths/dns/records/record.yml +++ b/platform/paths/dns/records/record.yml @@ -17,6 +17,7 @@ patch: required: true schema: type: string + - $ref: includes/RecordIncludeParam.yml requestBody: description: Parameters for updating a DNS Zone Record. The name value cannot be updated and is omitted from the properties. content: @@ -40,6 +41,8 @@ patch: properties: data: $ref: ../../../../components/schemas/dns/records/Record.yml + includes: + $ref: includes/RecordIncludes.yml default: $ref: ../../../../components/responses/errors/DefaultError.yml diff --git a/platform/paths/dns/records/records.yml b/platform/paths/dns/records/records.yml index 0e510a69..30c6fb65 100644 --- a/platform/paths/dns/records/records.yml +++ b/platform/paths/dns/records/records.yml @@ -11,21 +11,7 @@ get: required: true schema: type: string - - name: include - in: query - required: false - description: - A comma separated list of include values. Included resources will show - up under the root document's `include` field, with the key being the id of the included - resource. In the case of applying an include to a collection of resources, if two - resources share the same include, it will only appear once in the return. - schema: - type: array - items: - type: string - enum: - - creators - - containers + - $ref: includes/RecordIncludeParam.yml - name: filter in: query @@ -60,7 +46,7 @@ get: items: $ref: ../../../../components/schemas/dns/records/Record.yml includes: - $ref: ../../../../components/schemas/dns/records/RecordIncludes.yml + $ref: includes/RecordIncludes.yml default: $ref: ../../../../components/responses/errors/DefaultError.yml @@ -77,6 +63,7 @@ post: required: true schema: type: string + - $ref: includes/RecordIncludeParam.yml requestBody: description: Parameters for creating a new DNS Zone Record. content: @@ -105,5 +92,7 @@ post: properties: data: $ref: ../../../../components/schemas/dns/records/Record.yml + includes: + $ref: includes/RecordIncludes.yml default: $ref: ../../../../components/responses/errors/DefaultError.yml