-
-
Notifications
You must be signed in to change notification settings - Fork 893
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: handle uriTemplate on property for HAL format
- Loading branch information
1 parent
d1fc54c
commit 86ee2d0
Showing
4 changed files
with
84 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
@php8 | ||
@v3 | ||
Feature: Exposing a property being a collection of resources | ||
can return an IRI instead of an array | ||
when the uriTemplate is set on the ApiProperty attribute | ||
|
||
Scenario: Retrieve Resource with uriTemplate collection Property | ||
Given there are propertyCollectionIriOnly with relations | ||
When I add "Accept" header equal to "application/hal+json" | ||
And I send a "GET" request to "/property_collection_iri_onlies/1" | ||
Then the response status code should be 200 | ||
And the response should be in JSON | ||
And the JSON should be valid according to the JSON HAL schema | ||
And the header "Content-Type" should be equal to "application/hal+json; charset=utf-8" | ||
And the JSON should be equal to: | ||
""" | ||
{ | ||
"_links": { | ||
"self": { | ||
"href": "/property_collection_iri_onlies/1" | ||
}, | ||
"propertyCollectionIriOnlyRelation": { | ||
"href": "/property-collection-relations" | ||
}, | ||
"iterableIri": { | ||
"href": "/parent/1/another-collection-operations" | ||
} | ||
}, | ||
"_embedded": { | ||
"propertyCollectionIriOnlyRelation": [ | ||
{ | ||
"_links": { | ||
"self": { | ||
"href": "/property_collection_iri_only_relations/1" | ||
} | ||
}, | ||
"name": "relation" | ||
} | ||
], | ||
"iterableIri": [ | ||
{ | ||
"_links": { | ||
"self": { | ||
"href": "/property_collection_iri_only_relations/9999" | ||
} | ||
}, | ||
"name": "Michel" | ||
} | ||
] | ||
} | ||
} | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters