Skip to content

Commit 4d91fe5

Browse files
authored
Merge pull request #198 from aroskanalen/feature/398-route-v2
398: Changed route prefix to v2
2 parents 0aabf55 + f9a1c4e commit 4d91fe5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+515
-513
lines changed

.github/workflows/php_upgrade.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ jobs:
139139
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist --ignore-platform-reqs
140140

141141
- name: Export specifications
142-
run: bin/console api:openapi:export --yaml --output=public/api-spec-v1.yaml --no-interaction
142+
run: bin/console api:openapi:export --yaml --output=public/api-spec-v2.yaml --no-interaction
143143

144144
- name: Check for changes in specifications
145-
run: git diff --diff-filter=ACMRT --exit-code public/api-spec-v1.yaml
145+
run: git diff --diff-filter=ACMRT --exit-code public/api-spec-v2.yaml

.github/workflows/pr.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,16 +314,16 @@ jobs:
314314
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
315315

316316
- name: Export specifications (yaml)
317-
run: bin/console api:openapi:export --yaml --output=public/api-spec-v1.yaml --no-interaction
317+
run: bin/console api:openapi:export --yaml --output=public/api-spec-v2.yaml --no-interaction
318318

319319
- name: Check for changes in specifications (yaml)
320-
run: git diff --diff-filter=ACMRT --exit-code public/api-spec-v1.yaml
320+
run: git diff --diff-filter=ACMRT --exit-code public/api-spec-v2.yaml
321321

322322
- name: Export specifications (json)
323-
run: bin/console api:openapi:export --output=public/api-spec-v1.json --no-interaction
323+
run: bin/console api:openapi:export --output=public/api-spec-v2.json --no-interaction
324324

325325
- name: Check for changes in specifications (json)
326-
run: git diff --diff-filter=ACMRT --exit-code public/api-spec-v1.json
326+
run: git diff --diff-filter=ACMRT --exit-code public/api-spec-v2.json
327327

328328
changelog:
329329
runs-on: ubuntu-latest

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
- [#198](https://github.com/os2display/display-api-service/pull/198)
8+
- Changed route prefix to v2.
79
- [#197](https://github.com/os2display/display-api-service/pull/197)
810
- Fixed weight issue when assigning slides to playlist.
911
- [#194](https://github.com/os2display/display-api-service/pull/194)

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
## OpenAPI specification
44

5-
The OpenAPI specification is committed to this repo as `public/api-spec-v1.yaml`
6-
and as `public/api-spec-v1.json`.
5+
The OpenAPI specification is committed to this repo as `public/api-spec-v2.yaml`
6+
and as `public/api-spec-v2.json`.
77

88
A CI check will compare the current API implementation to the spec. If they
99
are different the check will fail.
@@ -18,7 +18,7 @@ If these are _breaking_ changes the API version must be changed accordingly.
1818

1919
## Stateless
2020

21-
The API is stateless except `/v1/authentication` routes.
21+
The API is stateless except `/v2/authentication` routes.
2222
Make sure to set the `CORS_ALLOW_ORIGIN` correctly in `.env.local`.
2323

2424
## Rest API & Relationships
@@ -27,7 +27,7 @@ To avoid embedding all relations in REST representations but still allow the cli
2727
they have to make all endpoints that have relations also has a `relationsModified` field:
2828

2929
```json
30-
"@id": "/v1/screens/000XB4RQW418KK14AJ054W1FN2",
30+
"@id": "/v2/screens/000XB4RQW418KK14AJ054W1FN2",
3131
...
3232
"relationsModified": {
3333
"campaigns": "cf9bb7d5fd04743dd21b5e3361db7eed575258e0",
@@ -155,11 +155,11 @@ docker compose exec phpfpm bin/console app:user:add
155155
```
156156

157157
You can now obtain a token by sending a `POST` request to the
158-
`/v1/authentication/token` endpoint:
158+
`/v2/authentication/token` endpoint:
159159

160160
```curl
161161
curl --location --request 'POST' \
162-
'http://displayapiservice.local.itkdev.dk/v1/authentication/token' \
162+
'http://displayapiservice.local.itkdev.dk/v2/authentication/token' \
163163
--header 'accept: application/json' \
164164
--header 'Content-Type: application/json' \
165165
--data '{
@@ -180,7 +180,7 @@ as the api key value. Or by adding an auth header to your requests
180180

181181
```curl
182182
curl --location --request 'GET' \
183-
'http://displayapiservice.local.itkdev.dk/v1/layouts?page=1&itemsPerPage=10' \
183+
'http://displayapiservice.local.itkdev.dk/v2/layouts?page=1&itemsPerPage=10' \
184184
--header 'accept: application/ld+json' \
185185
--header 'Authorization: Bearer <token>'
186186
```

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@
144144
"bin/console --env=test doctrine:migrations:migrate --no-interaction --quiet"
145145
],
146146
"update-api-spec": [
147-
"bin/console api:openapi:export --output=public/api-spec-v1.yaml --yaml --no-interaction",
148-
"bin/console api:openapi:export --output=public/api-spec-v1.json --no-interaction"
147+
"bin/console api:openapi:export --output=public/api-spec-v2.yaml --yaml --no-interaction",
148+
"bin/console api:openapi:export --output=public/api-spec-v2.json --no-interaction"
149149
]
150150
}
151151
}

config/api_platform/feed.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ resources:
3838
openapiContext:
3939
description: Get data from a feed.
4040
summary: Get data from a feed.
41-
operationId: get-v1-feed-id-data
41+
operationId: get-v2-feed-id-data
4242
tags:
4343
- Feeds
4444
parameters:
@@ -70,7 +70,7 @@ resources:
7070
- 'created.at.order_filter'
7171
- 'modified.at.order_filter'
7272
openapiContext:
73-
operationId: get-v1-feeds
73+
operationId: get-v2-feeds
7474
description: Retrieves a collection of Feed resources.
7575
summary: Retrieves a collection of Feed resources.
7676
tags:

config/api_platform/feed_source.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ resources:
4242
openapiContext:
4343
description: Get config for name from a feed source.
4444
summary: Get config for name from a feed source.
45-
operationId: get-v1-feed-source-id-config-name
45+
operationId: get-v2-feed-source-id-config-name
4646
tags:
4747
- FeedSources
4848
parameters:
@@ -78,7 +78,7 @@ resources:
7878
- 'modified.at.order_filter'
7979
- 'feed_source.search_filter'
8080
openapiContext:
81-
operationId: get-v1-feed-sources
81+
operationId: get-v2-feed-sources
8282
description: Retrieves a collection of FeedSource resources.
8383
summary: Retrieves a collection of FeedSource resources.
8484
tags:

config/api_platform/layout.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ resources:
1212
openapiContext:
1313
description: Retrieves a screen layout resource.
1414
summary: Retrieve a screen layout resource.
15-
operationId: get-v1-layouts-id
15+
operationId: get-v2-layouts-id
1616
tags:
1717
- Layouts
1818
parameters:
@@ -38,7 +38,7 @@ resources:
3838
summary: Retrieves a collection of layouts resources.
3939
tags:
4040
- Layouts
41-
operationId: get-v1-layouts
41+
operationId: get-v2-layouts
4242
parameters:
4343
- schema:
4444
type: integer

config/api_platform/media.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ resources:
1313
openapiContext:
1414
description: Retrieves a Media resource.
1515
summary: Retrieve a Media resource.
16-
operationId: getV1MediaById
16+
operationId: getv2MediaById
1717
tags:
1818
- Media
1919
parameters:
@@ -36,7 +36,7 @@ resources:
3636
openapiContext:
3737
description: Delete a Media resource.
3838
summary: Delete a Media resource.
39-
operationId: delete-v1-media-id
39+
operationId: delete-v2-media-id
4040
tags:
4141
- Media
4242
parameters:
@@ -60,7 +60,7 @@ resources:
6060
summary: Retrieves a collection of Media resources.
6161
tags:
6262
- Media
63-
operationId: get-v1-medias
63+
operationId: get-v2-medias
6464
parameters:
6565
- schema:
6666
type: integer

config/api_platform/playlist.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ resources:
1313
normalizationContext:
1414
jsonld_embed_context: true
1515
openapiContext:
16-
operationId: get-v1-playlist-id
16+
operationId: get-v2-playlist-id
1717
description: Retrieve a Playlist resource.
1818
summary: Retrieves a Playlist resource.
1919
tags:
@@ -38,7 +38,7 @@ resources:
3838
openapiContext:
3939
description: Update a Playlist resource.
4040
summary: Update a Playlist resource.
41-
operationId: put-v1-playlist-id
41+
operationId: put-v2-playlist-id
4242
tags:
4343
- Playlists
4444
parameters:
@@ -54,7 +54,7 @@ resources:
5454
openapiContext:
5555
description: Delete a Playlist resource.
5656
summary: Delete a Playlist resource.
57-
operationId: delete-v1-playlist-id
57+
operationId: delete-v2-playlist-id
5858
tags:
5959
- Playlists
6060
parameters:
@@ -77,7 +77,7 @@ resources:
7777
- 'modified.at.order_filter'
7878
- 'App\Filter\SharedWithMe'
7979
openapiContext:
80-
operationId: get-v1-playlists
80+
operationId: get-v2-playlists
8181
description: Retrieves a collection of Playlist resources.
8282
summary: Retrieve a collection of Playlist resources.
8383
tags:
@@ -103,7 +103,7 @@ resources:
103103
normalizationContext:
104104
jsonld_embed_context: true
105105
openapiContext:
106-
operationId: create-v1-playlist
106+
operationId: create-v2-playlist
107107
description: Creates a Playlist resource.
108108
summary: Creates a Playlist resource.
109109
tags:

0 commit comments

Comments
 (0)