Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Bug gii/api generated rules: enum with trim #158

Closed
siggi-k opened this issue Jan 9, 2024 · 0 comments · Fixed by SOHELAHMED7/yii2-openapi#40
Closed

Bug gii/api generated rules: enum with trim #158

siggi-k opened this issue Jan 9, 2024 · 0 comments · Fixed by SOHELAHMED7/yii2-openapi#40

Comments

@siggi-k
Copy link
Contributor

siggi-k commented Jan 9, 2024

initial

  • MariaDB
  • "schema.yaml" with attribute, which has type "enum"
    schema yaml
  • this new attribute can be NULL !

reproduction steps

  • execute ./yii gii/api to generate code and update model

bug

  • attribute is treated as a type string by applying trim in the function rules in abstract class from model.
    rules

  • this means that if the attribute was not passed and is therefore NULL, it becomes an empty string due to the validation. This in turn means that it cannot be saved as it is an enum.

@siggi-k siggi-k changed the title enum is generated with trim rules bug generated: enum with trim Jan 22, 2024
@siggi-k siggi-k changed the title rules bug generated: enum with trim gii/api generated rules bug: enum with trim Jan 22, 2024
@siggi-k siggi-k changed the title gii/api generated rules bug: enum with trim Bug gii/api generated rules: enum with trim Feb 5, 2024
SOHELAHMED7 added a commit to SOHELAHMED7/yii2-openapi that referenced this issue May 30, 2024
…s-enum-with-trim

Resolve: Bug gii/api generated rules: enum with trim cebe#158
@cebe cebe closed this as completed in 01846a8 Jun 4, 2024
cebe added a commit that referenced this issue Jun 4, 2024
| Fix Issue # | Fork PR # |
| ------ | ------ |
| #175 | SOHELAHMED7#36 |
| #172 | SOHELAHMED7#37 |
| #159  | SOHELAHMED7#39 |
| #158 | SOHELAHMED7#40 |
| #178 |
SOHELAHMED7#41 |
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant