diff --git a/nerm/openapi.yaml b/nerm/openapi.yaml index 8870f73..2e5b973 100644 --- a/nerm/openapi.yaml +++ b/nerm/openapi.yaml @@ -73,6 +73,8 @@ paths: /profile_types/{id}: $ref: "./paths/profile_types_id.yaml" # Synced attributes + /profile_types/{profile_type_id}/ne_attributes: + $ref: "./paths/profile_type_attributes.yaml" /profile_types/{profile_type_id}/synced_attributes: $ref: "./paths/synced_attributes.yaml" /profile_types/{profile_type_id}/synced_attributes/{ne_attribute_id}: diff --git a/nerm/parameters/path/attribute_id.yaml b/nerm/parameters/path/attribute_id.yaml index bd5d28e..1d1e72e 100644 --- a/nerm/parameters/path/attribute_id.yaml +++ b/nerm/parameters/path/attribute_id.yaml @@ -4,4 +4,5 @@ description: The id of the attachment attribute required: true schema: type: string - format: uuid \ No newline at end of file + format: uuid + example: 1246d8b3-ac29-4015-8154-dea4434a73fa \ No newline at end of file diff --git a/nerm/parameters/query/page.yaml b/nerm/parameters/query/page.yaml new file mode 100644 index 0000000..108d432 --- /dev/null +++ b/nerm/parameters/query/page.yaml @@ -0,0 +1,9 @@ +name: page +in: query +description: Pagination page number +required: false +schema: + type: integer + format: int32 + minimum: 1 + example: 5 \ No newline at end of file diff --git a/nerm/parameters/query/per_page.yaml b/nerm/parameters/query/per_page.yaml new file mode 100644 index 0000000..195609e --- /dev/null +++ b/nerm/parameters/query/per_page.yaml @@ -0,0 +1,9 @@ +name: page +in: query +description: Pagination items per page +required: false +schema: + type: integer + format: int32 + minimum: 1 + example: 5 \ No newline at end of file diff --git a/nerm/parameters/query/search.yaml b/nerm/parameters/query/search.yaml new file mode 100644 index 0000000..0293909 --- /dev/null +++ b/nerm/parameters/query/search.yaml @@ -0,0 +1,7 @@ +name: search +in: query +description: Filter by string +required: false +schema: + type: string + example: search \ No newline at end of file diff --git a/nerm/parameters/query/sort.yaml b/nerm/parameters/query/sort.yaml new file mode 100644 index 0000000..97750af --- /dev/null +++ b/nerm/parameters/query/sort.yaml @@ -0,0 +1,15 @@ +name: sort +in: query +description: How records should be sorted +required: false +schema: + type: object + example: { attr: "sync", order: "asc" } + properties: + attr: + type: string + example: sync + order: + type: string + enum: [asc, desc] + example: asc diff --git a/nerm/parameters/query/synced_attribute_active_filter.yaml b/nerm/parameters/query/synced_attribute_active_filter.yaml new file mode 100644 index 0000000..bd6bd1b --- /dev/null +++ b/nerm/parameters/query/synced_attribute_active_filter.yaml @@ -0,0 +1,8 @@ +name: active_filter +in: query +description: Filter for profile type synced attributes +required: false +schema: + type: string + enum: [synced, unsynced, all] + example: all \ No newline at end of file diff --git a/nerm/paths/profile_type_attributes.yaml b/nerm/paths/profile_type_attributes.yaml new file mode 100644 index 0000000..20d1153 --- /dev/null +++ b/nerm/paths/profile_type_attributes.yaml @@ -0,0 +1,20 @@ +get: + summary: profile_types/ne_attributes synced status + operationId: getProfileTypeAttributes + description: Get ne attributes and synced attribute relationship to profile type. + tags: + - synced attributes + parameters: + - $ref: "../parameters/path/profile_type_id.yaml" + - $ref: "../parameters/query/synced_attribute_active_filter.yaml" + - $ref: "../parameters/query/search.yaml" + - $ref: "../parameters/query/page.yaml" + - $ref: "../parameters/query/per_page.yaml" + - $ref: "../parameters/query/sort.yaml" + responses: + '200': + $ref: "../responses/ProfileTypeAttributes_Meta.yaml" + '400': + $ref: "../responses/400.yaml" + '500': + $ref: "../responses/500.yaml" diff --git a/nerm/responses/ProfileTypeAttributes_Meta.yaml b/nerm/responses/ProfileTypeAttributes_Meta.yaml new file mode 100644 index 0000000..999ecd3 --- /dev/null +++ b/nerm/responses/ProfileTypeAttributes_Meta.yaml @@ -0,0 +1,9 @@ +description: Expected response to a valid request +content: + application/json: + schema: + type: object + properties: + form: + type: object + $ref: '../schemas/GET/ProfileTypeAttributes.yaml' \ No newline at end of file diff --git a/nerm/schemas/GET/ProfileTypeAttribute.yaml b/nerm/schemas/GET/ProfileTypeAttribute.yaml new file mode 100644 index 0000000..6a2719e --- /dev/null +++ b/nerm/schemas/GET/ProfileTypeAttribute.yaml @@ -0,0 +1,26 @@ +type: object +properties: + id: + description: ID of ne attribute + type: string + format: uuid + readOnly: true + example: 1246d8b3-ac29-4015-8154-dea4434a73fa + uid: + description: Ne attribute's uid + type: string + minLength: 32 + maxLength: 32 + readOnly: true + example: 1246d8b3-ac29-4015-8154-dea4434a73fa + label: + description: Ne attribute's label + type: string + required: true + readOnly: true + example: object + synced: + description: synced_attribute ID if there is one + type: uuid + required: false + example: 1246d8b3-ac29-4015-8154-dea4434a73fa \ No newline at end of file diff --git a/nerm/schemas/GET/ProfileTypeAttributes.yaml b/nerm/schemas/GET/ProfileTypeAttributes.yaml new file mode 100644 index 0000000..876a762 --- /dev/null +++ b/nerm/schemas/GET/ProfileTypeAttributes.yaml @@ -0,0 +1,11 @@ +type: object +properties: + count: + type: integer + format: int32 + description: How many ne attribute records exist + example: 5 + records: + type: array + items: + $ref: './ProfileTypeAttribute.yaml' \ No newline at end of file