Skip to content

Commit

Permalink
feat: Add Fields impl for Link (#542)
Browse files Browse the repository at this point in the history
## Closes

-  #501 
## Description
Add implementation of `Field` trait for `Link`.

## Checklist

Delete any checklist items that do not apply (e.g. if your change is
minor, it may not require documentation updates).

- [x] Unit tests
- [ ] Documentation, including doctests
- [x] Git history is linear
- [x] Commit messages are descriptive
- [x] (optional) Git commit messages follow [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/)
- [x] Code is formatted (`cargo fmt`)
- [x] `cargo test`
- [x] Changes are added to the CHANGELOG

<!-- markdownlint-disable-file MD041 -->

---------

Co-authored-by: Pete Gadomski <pete.gadomski@gmail.com>
  • Loading branch information
alekzvik and gadomski authored Dec 3, 2024
1 parent 533a8b3 commit 2b97d76
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions crates/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Added

- `Fields` trait impl for `Link` ([#542](https://github.com/stac-utils/stac-rs/pull/542))

## [0.11.0] - 2024-11-12

### Added
Expand Down
1 change: 1 addition & 0 deletions crates/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ serde_json.workspace = true
thiserror.workspace = true
url = { workspace = true, features = ["serde"] }
tracing.workspace = true
stac-derive.workspace = true

[dev-dependencies]
assert-json-diff.workspace = true
Expand Down
1 change: 1 addition & 0 deletions crates/types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ pub use {

/// The default STAC version of this library.
pub const STAC_VERSION: Version = Version::v1_1_0;
extern crate self as stac_types;
3 changes: 2 additions & 1 deletion crates/types/src/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use crate::{mime::APPLICATION_GEOJSON, Error, Href, Result, SelfHref};
use mime::APPLICATION_JSON;
use serde::{Deserialize, Serialize};
use serde_json::{Map, Value};
use stac_derive::Fields;

/// Child links.
pub const CHILD_REL: &str = "child";
Expand Down Expand Up @@ -31,7 +32,7 @@ pub const COLLECTION_REL: &str = "collection";
/// Generally we keep STAC API structures in the [stac-api
/// crate](https://github.com/stac-utils/stac-rs/stac-api), but in this case it
/// was simpler to include these attributes in the base [Link] rather to create a new one.
#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
#[derive(Debug, Serialize, Deserialize, PartialEq, Clone, Fields)]
pub struct Link {
/// The actual link in the format of an URL.
///
Expand Down

0 comments on commit 2b97d76

Please sign in to comment.