Skip to content

Commit

Permalink
Merge pull request #1063 from PiwikPRO/feature/PPCDEV-18243-middlewar…
Browse files Browse the repository at this point in the history
…e-for-18.1
  • Loading branch information
chriskicker authored Sep 7, 2023
2 parents 8365185 + 6ca6a86 commit e92bbd6
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 11 deletions.
4 changes: 2 additions & 2 deletions platform/authorized_api/apps/public_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ components:
eCommerceTracking:
type: boolean
description: Enables e-commerce reports, additional tab is shown in Analytics module with e-commerce logs. Sales can be easily tracked using this setting.
default: false
example: false
default: true
example: true
siteSearchTracking:
deprecated: true
type: boolean
Expand Down
58 changes: 49 additions & 9 deletions platform/authorized_api/users/public_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ paths:
$ref: "#/components/examples/invalid_content_type"
Invalid JSON API content:
$ref: "#/components/examples/invalid_json_api_content"
Invalid attributes:
$ref: "#/components/examples/invalid_attributes"
403:
$ref: '#/components/responses/Forbidden'

Expand Down Expand Up @@ -123,6 +125,8 @@ paths:
$ref: "#/components/examples/invalid_content_type"
Invalid JSON API content:
$ref: "#/components/examples/invalid_json_api_content"
Invalid attributes:
$ref: "#/components/examples/invalid_attributes"
403:
$ref: '#/components/responses/Forbidden'
get:
Expand Down Expand Up @@ -232,7 +236,8 @@ paths:
$ref: "#/components/examples/forbidden"
404:
$ref: '#/components/responses/Not_Found'

409:
$ref: "#/components/responses/id_mismatch"
patch:
summary: Edit user
operationId: api_users_edit_v2
Expand Down Expand Up @@ -272,6 +277,8 @@ paths:
$ref: "#/components/examples/invalid_content_type"
Invalid JSON API content:
$ref: "#/components/examples/invalid_json_api_content"
Invalid attributes:
$ref: "#/components/examples/invalid_attributes"
403:
description: Forbidden
content:
Expand All @@ -284,7 +291,8 @@ paths:
$ref: "#/components/examples/forbidden"
404:
$ref: '#/components/responses/Not_Found'

409:
$ref: "#/components/responses/id_mismatch"
/api/users/v2/{userId}/change-role:
patch:
summary: Change user role
Expand Down Expand Up @@ -326,6 +334,8 @@ paths:
$ref: "#/components/examples/invalid_content_type"
Invalid JSON API content:
$ref: "#/components/examples/invalid_json_api_content"
Invalid attributes:
$ref: "#/components/examples/invalid_attributes"
403:
description: Forbidden
content:
Expand All @@ -338,6 +348,8 @@ paths:
$ref: "#/components/examples/forbidden"
404:
$ref: '#/components/responses/Not_Found'
409:
$ref: "#/components/responses/id_mismatch"

/api/users/v2/me/change-password:
patch:
Expand Down Expand Up @@ -373,8 +385,12 @@ paths:
$ref: "#/components/examples/invalid_content_type"
Invalid JSON API content:
$ref: "#/components/examples/invalid_json_api_content"
Invalid attributes:
$ref: "#/components/examples/invalid_attributes"
404:
$ref: '#/components/responses/Not_Found'
409:
$ref: "#/components/responses/id_mismatch"

/api/users/v2/me/details:
get:
Expand Down Expand Up @@ -447,11 +463,14 @@ paths:
$ref: "#/components/examples/invalid_content_type"
Invalid JSON API content:
$ref: "#/components/examples/invalid_json_api_content"
Invalid attributes:
$ref: "#/components/examples/invalid_attributes"
403:
$ref: '#/components/responses/Forbidden'
404:
$ref: '#/components/responses/Not_Found'

409:
$ref: "#/components/responses/id_mismatch"
components:
parameters:
Offset:
Expand All @@ -463,7 +482,7 @@ components:
minimum: 0
default: 0
required: false

Limit:
in: query
name: limit
Expand All @@ -474,7 +493,7 @@ components:
minimum: 0
maximum: 1000
required: false

search:
name: search
in: query
Expand All @@ -483,7 +502,7 @@ components:
schema:
type: string
default: ''

search_query:
name: search_query
in: query
Expand Down Expand Up @@ -779,7 +798,7 @@ components:
type: string
example: offset
description: a string indicating which URI query parameter caused the error

responses:
Forbidden:
description: Forbidden
Expand All @@ -791,6 +810,22 @@ components:
examples:
Forbidden:
$ref: "#/components/examples/forbidden"
id_mismatch:
description: Conflict
content:
application/vnd.api+json:
schema:
allOf:
- $ref: "#/components/schemas/ErrorObject"
examples:
Id mismatch:
value:
errors:
- status: '409'
code: error
detail: "The resource object's id (985ed9d7-b652-47b8-b9cf-c17d62735261) does not match url's lookup id (8209367f-691b-475e-84c3-d1c69f46075b)"
source:
pointer: /data
Not_Found:
description: Not Found
content:
Expand All @@ -801,7 +836,6 @@ components:
examples:
User does not exist:
$ref: "#/components/examples/user_does_not_exist"

examples:
forbidden:
value:
Expand Down Expand Up @@ -830,7 +864,7 @@ components:
- status: '400'
title: Invalid form
code: users.error.unsupported-language
detail: 'Language "pl" is not supported (supported are en, de, fi, fr, nl, sv)'
detail: 'Language "pl" is not supported (supported are de, en, fi, fr, nl, sv)'
source:
pointer: /language
unsupported_language_tag:
Expand Down Expand Up @@ -995,3 +1029,9 @@ components:
- status: '400'
title: Invalid query parameter 'sort' - available options are [email,addedAt,role] - got 'example'
code: error.default
invalid_attributes:
value:
errors:
- status: '400'
title: "Invalid field 'attributes' - value should be an object - got 'int'"
code: error.default

0 comments on commit e92bbd6

Please sign in to comment.