ソースを参照

Partner API type

master
Florian Eisenmenger 2年前
コミット
41efd738e6
3個のファイルの変更45行の追加0行の削除
  1. +2
    -0
      README.md
  2. +41
    -0
      openapi.yaml
  3. +2
    -0
      src/ApiResource/PartnerApi.php

+ 2
- 0
README.md ファイルの表示

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


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

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


+ 41
- 0
openapi.yaml ファイルの表示

@@ -420,6 +420,47 @@ paths:
style: form style: form
explode: false explode: false
allowReserved: 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 deprecated: false
post: post:
operationId: api_partners_post operationId: api_partners_post


+ 2
- 0
src/ApiResource/PartnerApi.php ファイルの表示

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




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


読み込み中…
キャンセル
保存