Closed meneken17 closed 4 years ago
Describe the bug
To Reproduce 1) .yaml file contains:
LocationAttributes: type: object properties: name: Name lat: type: number format: float lon: type: number format: float Location: type: object properties: type: Type id: ID attributes: LocationAttributes
2) generate api 3) migrate
This will create ..._create_location_table.php
..._create_location_table.php
8| public function up() 9| { 10| Schema::create('location', function(Blueprint $table) { 11| $table->bigIncrements('id'); > 12| $table->float('lat', array, array); 13| $table->float('lon', array, array); 14| $table->timestamps(); 15| }); 16| }
Which will throw syntax error, unexpected ',', expecting '(' because array expects arguments.
syntax error, unexpected ',', expecting '('
array
This is caused by MigrationTraits.php line 124/125:
MigrationTraits.php
$max = empty($attrVal[ApiInterface::RAML_INTEGER_MAX]) ? PhpInterface::PHP_TYPES_ARRAY : $attrVal[ApiInterface::RAML_INTEGER_MAX]; $min = empty($attrVal[ApiInterface::RAML_INTEGER_MIN]) ? PhpInterface::PHP_TYPES_ARRAY : $attrVal[ApiInterface::RAML_INTEGER_MIN];
I am not quite sure what value would make sense here but array apperantly not.
Hi, thank u for exploring this bug and detailed description, I'll try to fix it right-away.
Added default values for double/float types.
Describe the bug
To Reproduce 1) .yaml file contains:
2) generate api 3) migrate
This will create
..._create_location_table.php
Which will throw
syntax error, unexpected ',', expecting '('
becausearray
expects arguments.This is caused by
MigrationTraits.php
line 124/125:I am not quite sure what value would make sense here but
array
apperantly not.