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

Adding support for RF6902 for path requests. #14

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Support for [RFC 6902](https://tools.ietf.org/html/rfc6902) [#14](https://github.com/stac-api-extensions/transaction/pull/14)

### Changed

- Updated of [RFC 7386](https://tools.ietf.org/html/rfc7386) to [RFC 7396](https://tools.ietf.org/html/rfc7396) [#14](https://github.com/stac-api-extensions/transaction/pull/14)

## [v1.0.0-rc.3] - 2023-09-28

- Remove assertion that this will align with OAF Part 4.
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ All cases:
- Must return 404 if no Item exists for this resource URI.
- If the `id` or `collection` fields are different from those in the URI, status code 400 shall be returned.

PATCH is compliant with [RFC 7386](https://tools.ietf.org/html/rfc7386).
The default standard for PATCH is [RFC 7396](https://tools.ietf.org/html/rfc7396).
Optionally, in addition to RFC 7396, [RFC 6902](https://tools.ietf.org/html/rfc6902) can be supported with the two methods
being distinguished via the Accept/Content-Type header.

### DELETE

Expand Down
91 changes: 83 additions & 8 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ paths:
- $ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/parameters/collectionId"
post:
summary: add a new STAC Item or Items in an ItemCollection to a collection
description: create a new STAC Item r Items in an ItemCollection in a specific collection
description: create a new STAC Item or Items in an ItemCollection in a specific collection
operationId: postFeature
tags:
- Transaction
Expand Down Expand Up @@ -137,8 +137,12 @@ paths:
patch:
summary: update an existing feature by Id with a partial item definition
description: >-
Use this method to update an existing feature. Requires a GeoJSON
fragment (containing the fields to be updated) be submitted.
Use this method to update an existing feature. The default method, merge-patch adheres to RF7396
and requires a GeoJSON fragment (containing the fields to be updated) be submitted. Null values in
the merge patch are given special meaning to indicate the removal of existing values in the
target. Optionally json-patch, which adheres to RF6902 and requires a sequence of opperations to
perform on the target feature, can be included. The two methods can be distinguished via the
Accept/Content-Type header.
operationId: patchFeature
tags:
- Transaction
Expand All @@ -148,10 +152,16 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/patchItem"
$ref: "#/components/schemas/mergePatchItem"
application/merge-patch+json:
schema:
$ref: "#/components/schemas/mergePatchItem"
application/json-patch+json:
schema:
$ref: "#/components/schemas/patchRequest"
responses:
"200":
description: The item was replaced
description: The item was updated
headers:
ETag:
schema:
Expand All @@ -162,7 +172,7 @@ paths:
schema:
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/schemas/item"
"202":
description: The item was accepted for asynchronous action
description: The request was accepted for asynchronous action
"204":
description: Status of the update request.
headers:
Expand Down Expand Up @@ -228,9 +238,74 @@ components:
schema:
type: string
schemas:
patchItem:
patchRequest:
description: >-
An array that containing the sequence of opperations to apply to the target item.
type: array
items:
oneOf:
- $ref: '#/components/schemas/patchRequestAddReplaceTest'
- $ref: '#/components/schemas/patchRequestRemove'
- $ref: '#/components/schemas/patchRequestMoveCopy'
patchRequestAddReplaceTest:
type: object
additionalProperties: false
required:
- value
- op
- path
properties:
path:
description: A JSON Pointer path.
type: string
value:
description: The value to add, replace or test.
op:
description: The operation to perform.
type: string
enum:
- add
- replace
- test
patchRequestRemove:
type: object
additionalProperties: false
required:
- op
- path
properties:
path:
description: A JSON Pointer path.
type: string
op:
description: The operation to perform.
type: string
enum:
- remove
patchRequestMoveCopy:
type: object
additionalProperties: false
required:
- from
- op
- path
properties:
path:
description: A JSON Pointer path.
type: string
op:
description: The operation to perform.
type: string
enum:
- move
- copy
from:
description: A JSON Pointer path.
type: string
mergePatchItem:
description: >-
An object that contains at least a subset of the fields for a STAC Item.
An object that contains at least a subset of the fields for a STAC Item. Null values in the merge
patch are given special meaning to indicate the removal of existing values in the target.
type: object
properties:
stac_version:
Expand Down