api-platform / api-platform/schema-generator

[OpenApi] PropertyGenerator::getType(): Argument #1 ($type) must be of type string, null given

未關閉
#398 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
PHP
星號
474
分支
107
PR 合併指標
30 天內沒有已合併 PR

描述

**schema-gen version(s) affected**: 5.1.1

**Description**

Received an exception when processing a json API schema.

**How to reproduce**
*Config*
```
# api/config/schema.yaml
openApi:
file: './swagger.json'
```
`>schema gen sgen\src schema.yml`
*schema file is attached* [swagger.zip](https://github.com/api-platform/schema-generator/files/9942826/swagger.zip)

**Additional Context**

![image](https://user-images.githubusercontent.com/983484/200097120-0e36d808-19eb-4df2-89f1-41ab6b6e9f47.png)
```
PHP Fatal error: Uncaught TypeError: ApiPlatform\SchemaGenerator\OpenApi\PropertyGenerator\PropertyGenerator::getType(): Argument #1 ($type) must be of type string, null given, called in phar://C:/dev/tools/schema.phar/src/OpenApi/PropertyGenerator/PropertyGenerator.php on line 54 and defined in phar://C:/dev/tools/schema.phar/src/OpenApi/PropertyGenerator/PropertyGenerator.php:73
Stack trace:
#0 phar://C:/dev/tools/schema.phar/src/OpenApi/PropertyGenerator/PropertyGenerator.php(54): ApiPlatform\SchemaGenerator\OpenApi\PropertyGenerator\PropertyGenerator->getType()
#1 phar://C:/dev/tools/schema.phar/src/OpenApi/ClassGenerator.php(232): ApiPlatform\SchemaGenerator\OpenApi\PropertyGenerator\PropertyGenerator->__invoke()
#2 phar://C:/dev/tools/schema.phar/src/OpenApi/ClassGenerator.php(105): ApiPlatform\SchemaGenerator\OpenApi\ClassGenerator->buildClassFromSchema()
#3 phar://C:/dev/tools/schema.phar/src/OpenApi/Generator.php(54): ApiPlatform\SchemaGenerator\OpenApi\ClassGenerator->generate()
#4 phar://C:/dev/tools/schema.phar/src/Command/GenerateCommand.php(139): ApiPlatform\SchemaGenerator\OpenApi\Generator->generate()
#5 phar://C:/dev/tools/schema.phar/vendor/symfony/console/Command/Command.php(308): ApiPlatform\SchemaGenerator\Command\GenerateCommand->execute()
#6 phar://C:/dev/tools/schema.phar/vendor/symfony/console/Application.php(1002): Symfony\Component\Console\Command\Command->run()
#7 phar://C:/dev/tools/schema.phar/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand()
#8 phar://C:/dev/tools/schema.phar/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#9 phar://C:/dev/tools/schema.phar/bin/schema(26): Symfony\Component\Console\Application->run()
#10 C:\dev\tools\schema.phar(17): require('...')
#11 {main}
thrown in phar://C:/dev/tools/schema.phar/src/OpenApi/PropertyGenerator/PropertyGenerator.php on line 73

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。