Browse Source

Partner API type

master
Florian Eisenmenger 2 years ago
parent
commit
41efd738e6
3 changed files with 45 additions and 0 deletions
  1. +2
    -0
      README.md
  2. +41
    -0
      openapi.yaml
  3. +2
    -0
      src/ApiResource/PartnerApi.php

+ 2
- 0
README.md View File

@@ -101,6 +101,8 @@
ddev exec bin/console api:openapi:export --yaml >> openapi.yaml
-> export OpenApi spec

(Achtung: Erst die alte OpenApi.yaml löschen!)

# Lexik JWT
- https://symfony.com/bundles/LexikJWTAuthenticationBundle/current/index.html
- Nur bei NEU Installation:


+ 41
- 0
openapi.yaml View File

@@ -420,6 +420,47 @@ paths:
style: form
explode: false
allowReserved: false
-
name: 'order[name]'
in: query
description: ''
required: false
deprecated: false
allowEmptyValue: true
schema:
type: string
enum:
- asc
- desc
style: form
explode: false
allowReserved: false
-
name: type
in: query
description: ''
required: false
deprecated: false
allowEmptyValue: true
schema:
type: string
style: form
explode: false
allowReserved: false
-
name: 'type[]'
in: query
description: ''
required: false
deprecated: false
allowEmptyValue: true
schema:
type: array
items:
type: string
style: form
explode: true
allowReserved: false
deprecated: false
post:
operationId: api_partners_post


+ 2
- 0
src/ApiResource/PartnerApi.php View File

@@ -9,6 +9,7 @@ namespace App\ApiResource;


use ApiPlatform\Doctrine\Orm\Filter\OrderFilter;
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
use ApiPlatform\Doctrine\Orm\State\Options;
use ApiPlatform\Metadata\ApiFilter;
use ApiPlatform\Metadata\ApiProperty;
@@ -50,6 +51,7 @@ use Symfony\Component\Validator\Constraints\NotBlank;
stateOptions: new Options(entityClass: Partner::class)
)]
#[ApiFilter(OrderFilter::class, properties: ['name'], arguments: ['orderParameterName' => 'order'])]
#[ApiFilter(SearchFilter::class, properties: ['type' => 'exact'])]
class PartnerApi
{
#[ApiProperty(readable: false, writable: false, identifier: true)]


Loading…
Cancel
Save