Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve HTTP accept header parsing of API versions; Reintroduce colorcapabilities in API version v1.1 #3703

Merged
merged 2 commits into from Nov 28, 2020

Conversation

manup
Copy link
Member

@manup manup commented Nov 19, 2020

Improve HTTP accept header parsing of API versions

  • Always pick the largest supported version;
  • Support headers with multiple versions;
  • To add more versions simply extend the array.

The getAcceptHeaderApiVersion() is a pure function for easier testing later on.

Reintroduce colorcapabilities in API version v1.1

For clients which support vnd.ddel.v1 or don't provide an API version this won't be a breaking change and colorcapabilities still returns a number. Clients which support vnd.ddel.v1.1 need to support colorcapabilities as array.

Related PR #3642

- Always pick the largest supported version;
- Support headers with multiple versions;
- To add more versions simply extend the array.

The `getAcceptHeaderApiVersion()` is a pure function for easier testing later on.
For clients with v1.0 this won't be a breaking change and colorcapabilities still returns a number.
Clients which support v1.1 need to support colorcapabilities as array.

Related PR dresden-elektronik#3642
@manup manup requested review from ebaauw and SwoopX November 19, 2020 11:40
@manup manup merged commit 1a3f22f into dresden-elektronik:master Nov 28, 2020
manup added a commit to manup/deconz-rest-plugin that referenced this pull request Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant