Skip to content

Commit 810b944

Browse files
committed
fix: address review comments
1 parent 6995ea3 commit 810b944

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Changed
1111

12-
- Include/exclude recommendations ([#5](https://github.com/stac-api-extensions/fields/pull/5))
12+
- Include/exclude semantics are more precisely defined ([#5](https://github.com/stac-api-extensions/fields/pull/5))
1313

1414
## [v1.0.0-rc.2] - TBD
1515

README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,17 @@ name, e.g., `properties.datetime` or `datetime`.
7171

7272
## Include/Exclude Semantics
7373

74-
1. If `fields` attribute is specified as an empty object (for POST requests), an empty string (for GET requests),
75-
or with both `include` and `exclude` set to null or an
76-
empty array, then the recommended behavior is to include only fields
77-
`type`, `stac_version`, `id`, `geometry`, `bbox`, `links`, `assets`, and `properties.datetime`; if `properties.datetime` is null, then it is recommended to include `properties.start_datetime` and `properties.end_datetime`.
74+
1. If `fields` attribute is specified as an empty string (GET requests) or as an empty object or an object with both `include` and `exclude` set to either null or an
75+
empty array (for POST requests), then the recommended behavior is to include only fields
76+
`type`, `stac_version`, `id`, `geometry`, `bbox`, `links`, `assets`, and `properties.datetime`. If `properties.datetime` is null, then it is recommended to include `properties.start_datetime` and `properties.end_datetime`.
7877
These are the default fields to ensure a valid STAC Item is returned by default.
7978
Implementations may choose to include other properties, e.g., `properties.created`, but the number
8079
of default properties fields should be kept to a minimum.
8180
2. If only `include` is specified, these fields should be the only fields included.
8281
Any additional fields provided beyond those in the `include` list should be kept
8382
to a minimum, as the caller has explicitly stated they do not need them.
84-
3. If only `exclude` is specified, the specified fields fields should not be
85-
included in the response Item entity, but every other field available for the
83+
3. If only `exclude` is specified, the specified fields should not be
84+
included, but every other field available for the
8685
Item should be included.
8786
4. If `exclude` is specified and `include` is null or an empty
8887
array, then the `exclude` fields should be excluded from the default set.
@@ -97,7 +96,7 @@ example:
9796
2. If a field is in `include`, and a nested field of that field is in `exclude`, the field
9897
should be included, and the nested field should be excluded. For example,
9998
if `properties` is included and `properties.datetime` is excluded, then
100-
`datetime` should not be in `properties`.
99+
`datetime` should not be in `properties`, but every other nested field should be.
101100
6. If the same field is present in both `include` and `exclude`, it should be included.
102101

103102
### `null` vs. empty vs. missing
@@ -182,6 +181,8 @@ missing. For example, this is a case of `include` being empty (NOT missing):
182181

183182
## Examples
184183

184+
### Default fields
185+
185186
Return the default fields. This should return valid STAC Item entities.
186187

187188
Query Parameters
@@ -199,6 +200,8 @@ JSON
199200
}
200201
```
201202

203+
### Explicitly get a valid STAC Item
204+
202205
This has a similar effect as an empty object for `fields`, but it is up to the discretion of the implementation.
203206

204207
Query Parameters
@@ -226,6 +229,8 @@ JSON
226229
}
227230
```
228231

232+
### Exclude geometry
233+
229234
Exclude `geometry` from the full item. This will return an entity that is not a valid GeoJSON Feature or a valid STAC Item.
230235

231236
Query Parameters
@@ -246,6 +251,8 @@ JSON
246251
}
247252
```
248253

254+
### Minimal subset
255+
249256
Return the `id`, `type`, `geometry`, and the Properties field `eo:cloud_cover`.
250257
This is not guaranteed not return a valid STAC Item, since not all required Item
251258
fields are included, but an implementor may choose to return a valid STAC
@@ -272,6 +279,8 @@ JSON
272279
}
273280
```
274281

282+
### Exclude a nested fiels
283+
275284
To include `id` and all the properties fields, except for the `foo` field.
276285

277286
Query Parameters

0 commit comments

Comments
 (0)