Skip to content

Commit

Permalink
Default embedded entity properties (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonredding authored Mar 15, 2023
1 parent ce184e6 commit aa6d6be
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ 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).

## [0.6.2]

### Fixed

- `EmbeddedEntity`'s `properties` now default to an empty object ([#19](https://github.com/siren-js/client/issues/19))

## [0.6.1]

### Fixed
Expand Down Expand Up @@ -88,6 +94,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0),
- `submit()` method for submitting actions; currently, only actions whose `type` is `"application/x-www-form-urlencoded"` are supported.
- Client `Response` wrapper for parsing Siren responses

[0.6.2]: https://github.com/siren-js/client/compare/v0.6.1...v0.6.2
[0.6.1]: https://github.com/siren-js/client/compare/v0.6.0...v0.6.1
[0.6.0]: https://github.com/siren-js/client/compare/v0.5.0...v0.6.0
[0.5.0]: https://github.com/siren-js/client/compare/v0.4.0...v0.5.0
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@siren-js/client",
"version": "0.5.0",
"version": "0.0.0",
"description": "Client class for communicating with Siren APIs",
"files": [
"/dist"
Expand Down
2 changes: 1 addition & 1 deletion src/models/embedded-entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class EmbeddedEntity<T extends object = object> {
*/
@IsObject()
@IsOptional()
properties?: T;
properties: T = {} as T;

/**
* List of strings describing the relationship of the `EmbeddedEntity` to its parent, per [RFC 8288](https://tools.ietf.org/html/rfc8288).
Expand Down

0 comments on commit aa6d6be

Please sign in to comment.