Skip to content

Commit

Permalink
Merge branch 'hotfix/v1.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
silvamfilipe committed Jan 29, 2024
2 parents ea14820 + 246c4e6 commit 9ac4447
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 17 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [v1.3.1] 2024-01-29
### Fix
- when using a getter, the return value should be evaluated so that it can be
transformed in a usable JSON API scalar.

## [v1.3.0] 2024-01-25
### Adds
- a formatter expression that can be used when encoding objects that have a
Expand Down Expand Up @@ -172,7 +177,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- JsonApi Object
- Meta's information object

[Unreleased]: https://github.com/slickframework/json-api/compare/v1.2.2...HEAD
[Unreleased]: https://github.com/slickframework/json-api/compare/v1.3.1...HEAD
[v1.3.1]: https://github.com/slickframework/json-api/compare/v1.3.0...v1.3.1
[v1.3.0]: https://github.com/slickframework/json-api/compare/v1.2.2...v1.3.0
[v1.2.2]: https://github.com/slickframework/json-api/compare/v1.2.1...v1.2.2
[v1.2.1]: https://github.com/slickframework/json-api/compare/v1.2.0...v1.2.1
[v1.2.0]: https://github.com/slickframework/json-api/compare/v1.1.3...v1.2.0
Expand Down
2 changes: 1 addition & 1 deletion src/Document/HttpMessageParser/LinksMemberParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ private static function parseLinkObject(object $linkData): Link
{
return new Link(DocumentParser::getMandatoryProperty($linkData, 'href'));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,4 @@ public function parse(): ToManyRelationship

return $relationship;
}


}
2 changes: 1 addition & 1 deletion src/Exception/InvalidResourceDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
final class InvalidResourceDocument extends InvalidArgumentException implements JsonApiException
{

}
}
4 changes: 1 addition & 3 deletions src/MetaAwareObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,4 @@ public function meta(): ?Meta;
* @return MetaAwareObject|Document
*/
public function withMeta(Meta $meta): MetaAwareObject;


}
}
1 change: 0 additions & 1 deletion src/Object/Links.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,4 @@ public function toArray(): array
{
return $this->links->toArray();
}

}
2 changes: 1 addition & 1 deletion src/Object/ResourceCollectionSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
interface ResourceCollectionSchema extends ResourceSchema
{

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ private function getValue(object $object): string|int|bool|float|array|null
{
$value = $this->extractPropertyValue($object);

$getter = $this->getter;
if ($getter && $value) {
$value = $value->$getter();
}

if (is_scalar($value) || is_array($value) || is_null($value)) {
return $value;
}

$getter = $this->getter;
if ($getter) {
return $value->$getter();
}

$format = $this->format;
if ($format && method_exists($value, 'format')) {
return $value->format($format);
Expand Down
1 change: 0 additions & 1 deletion src/Object/SchemaDiscover/DecodableAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,4 @@ public function assignValue(object $decodedObject, ResourceObject $resourceObjec
* @param SchemaDecodeValidator $validator
*/
public function validate(ResourceObject $resourceObject, SchemaDecodeValidator $validator): void;

}
2 changes: 1 addition & 1 deletion src/Validator/SchemaDecodeValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ public function add(
* @return FailedValidation|null
*/
public function exception(): ?FailedValidation;
}
}

0 comments on commit 9ac4447

Please sign in to comment.