Skip to content

Commit da9e033

Browse files
committed
WIP
1 parent 28eff82 commit da9e033

File tree

5 files changed

+7
-2
lines changed

5 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
## [Unreleased]
88
### Added
99
- Automatically encode DateTime objects as an ISO-8601 string
10+
- The "conflict" server response
1011

1112
### Changed
1213
- URL Design matching now respects the base URL

lib/src/http/status_code.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ extension type StatusCode(int value) {
77
static const notFound = 404;
88
static const methodNotAllowed = 405;
99
static const notAcceptable = 406;
10+
static const conflict = 406;
1011
static const unsupportedMediaType = 415;
1112
static const internalServerError = 500;
1213

lib/src/routing/uri_design.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
abstract class UriDesign {
1+
abstract interface class UriDesign {
22
Uri collection(String type);
33

44
Uri resource(String type, String id);

lib/src/server/response.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ Response created(OutboundDocument document, String location) =>
2626
Response notFound([OutboundErrorDocument? document]) =>
2727
response(StatusCode.notFound, document: document);
2828

29+
Response conflict([OutboundErrorDocument? document]) =>
30+
response(StatusCode.conflict, document: document);
31+
2932
Response methodNotAllowed([OutboundErrorDocument? document]) =>
3033
response(StatusCode.methodNotAllowed, document: document);
3134

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: json_api
2-
version: 9.0.0-alpha.7
2+
version: 9.0.0-alpha.8
33
homepage: https://github.com/f3ath/json-api-dart
44
description: A framework-agnostic implementations of JSON:API Client and Server. Supports JSON:API v1.0 (https://jsonapi.org)
55
environment:

0 commit comments

Comments
 (0)