1000 search results

192 lines | src/Entity/User.php
// ... lines 1 - 6
use ApiPlatform\Core\Annotation\ApiSubresource;
// ... lines 8 - 26
class User implements UserInterface
{
// ... lines 29 - 62
/**
// ... lines 64 - 66
* @ApiSubresource()
*/
private $cheeseListings;
// ... lines 70 - 190
}
See Code Block in Script
128 lines | src/Entity/User.php
// ... lines 1 - 4
use ApiPlatform\Core\Annotation\ApiResource;
// ... lines 6 - 8
/**
* @ApiResource()
// ... line 11
*/
class User implements UserInterface
// ... lines 14 - 128
See Code Block in Script
150 lines | src/Entity/CheeseListing.php
// ... lines 1 - 7
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\RangeFilter;
// ... lines 9 - 14
/**
* @ApiResource(
// ... lines 17 - 27
* @ApiFilter(RangeFilter::class, properties={"price"})
// ... line 29
*/
class CheeseListing
// ... lines 32 - 150
See Code Block in Script
164 lines | src/Entity/CheeseListing.php
// ... lines 1 - 9
use ApiPlatform\Core\Serializer\Filter\PropertyFilter;
// ... lines 11 - 15
/**
* @ApiResource(
// ... lines 18 - 29
* @ApiFilter(PropertyFilter::class)
// ... line 31
*/
class CheeseListing
// ... lines 34 - 164
See Code Block in Script
146 lines | src/Entity/CheeseListing.php
// ... lines 1 - 6
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\BooleanFilter;
// ... lines 8 - 146
See Code Block in Script
148 lines | src/Entity/CheeseListing.php
// ... lines 1 - 7
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
// ... lines 9 - 13
/**
// ... lines 15 - 25
* @ApiFilter(SearchFilter::class, properties={"title": "partial"})
// ... line 27
*/
class CheeseListing
// ... lines 30 - 148
See Code Block in Script
I am using `api-platform/core` version 3.2.26 and adding a php comments for $value does not show up in the docs. I had to use `ApiProperty `like this: ``` use ApiPlatform\Metadata\ApiProperty; ... #[ApiProperty(description: 'The estimated value of this treasure, in gold…
…if you want to HAL format api run. nothing HAL code present into api-platform vendor. If you add format config like that : '`jsonhal: ['application/hal+json']`' clear cache produce this error : ` Invalid service "api_platform.hal.normalizer.entrypoint": class "ApiPlatform\Hal\Serializer\EntrypointNormalizer" does…
Hi, Why api platform now gives duplicate properties from hydra docs? For example, my expected JSON POST input looks like this: ``` { "first_name": "string", "last_name": "string", "email": "string", "created_at": "2024-05-04T13:57:39.582Z", "firstName": "string", "lastName": "string", "createdAt": "2024-05-04T13…
Hey |mention:81069| ApiPlatform changed the PUT behavior after this tutorial was released. The PUT operation now works as full update of the resource (you need to send all the fields), and PATCH works to update only the submitted fields Here's a video where…
MolloKhan
MolloKhan
Read Full Comment
…the project code but api platform 3.2 as that is what is installed with 'composer require api'): The subresource works, I can enter '4' in the docs for the user_id field and I get all treasures that have /api/users/4 as owner…
Joris-Mak
Joris-Mak
Read Full Comment
> #[AsDecorator('api_platform.jsonld.normalizer.item')] > class AddOwnerGroupsNormalizer implements NormalizerInterface What if I want to keep support for other formats as well? Like JSON-HAL etc... Should I remove `AsDecorator` from my normalizer and move the decoration config to `services.yaml` as mentioned…
That's because your api_platform.yaml doesn't contain format for json ``` api_platform: title: Hello API Platform version: 1.0.0 formats: jsonld: ['application/ld+json'] json: ['application/json'] ``` you should add accept method ``` json: ['application/json'] ```
import { HydraAdmin } from "@api-platform/admin";
import React from 'react';
export default (props) => (
<HydraAdmin entrypoint={props.entrypoint} />
);
See Code Block in Script
I changed the "api-platform/core" version in the composer from 3.2.2 to 3.2.0, now the error is gone, https://127.0.0.1:8000/api is loading. But when I try to execute a get request, I still get the…
What about **API Platform 3 Part 4: Using graphql to the fullest?**
DataTransformerInterface is deprecated with API Platform 3: https://api-platform.com/docs/core/upgrade-guide/#summary-of-the-changes-between-26-and-2730
Sylvain-P
Sylvain-P
Read Full Comment
…I think in this case, you can create a second getter, giving the exact same relation with another name and wihtout eager loading. In combination with https://api-platform.com/docs/core/serialization/#embedding-relations > Normalization Groups ( #[Groups('book')] ) even this should be possbile.
Is the service ApiPlatform\Core\DataPersister\DataPersisterInterface available in Api Platform 3.0 and higher? Symfony can't see this.
Hi, In Api Platform 3 there is no ```php ApiPlatform\Core\DataProvider\CollectionDataProviderInterface; ApiPlatform\Core\DataProvider\ContextAwareCollectionDataProviderInterface; ApiPlatform\Core\DataProvider\DenormalizedIdentifiersAwareItemDataProviderInterface; ApiPlatform\Core\DataProvider\ItemDataProviderInterface; ApiPlatform\Core\DataProvider\RestrictedDataProviderInterface; ``` How to handle this Custom Field via Data Provider?