Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: allOf with description #51

Open
siggi-k opened this issue Sep 12, 2024 · 2 comments · May be fixed by #55
Open

Bug: allOf with description #51

siggi-k opened this issue Sep 12, 2024 · 2 comments · May be fixed by #55
Assignees

Comments

@siggi-k
Copy link

siggi-k commented Sep 12, 2024

Invoice.yaml

title: Invoice
x-table: invoices
type: object
properties:
  id:
    type: integer
  reference_invoice:
    allOf:
      - $ref: '#/components/schemas/Invoice'
      - x-faker: false
      - description: This field is only set on invoices of type "cancellation_invoice"

Bug: description don't work with allOf. Is not displayed in the generated BaseModel.

@SOHELAHMED7
Copy link
Member

At this moment, every custom OpenAPI extension such as x-faker, x-fk-on-update etc. with allOf is manually dealt with. description is not handled at all.

php-openapi make it easy to read allOf but it does not resolve allOf yet.

I have created cebe/php-openapi#208 to make handling and resolving of allOf dynamic. If merged and released, I will upgrade php-openapi repo in this repo and remove custom handling of above keywords in yii2-openapi.

Though I will still create a test in yii2-openapi using cebe/php-openapi#208 to ensure this issue is fixed.

SOHELAHMED7 added a commit to SOHELAHMED7/php-openapi that referenced this issue Sep 23, 2024
@SOHELAHMED7 SOHELAHMED7 self-assigned this Sep 24, 2024
@SOHELAHMED7 SOHELAHMED7 linked a pull request Sep 24, 2024 that will close this issue
@SOHELAHMED7 SOHELAHMED7 linked a pull request Sep 24, 2024 that will close this issue
@SOHELAHMED7
Copy link
Member

Though current state of pull request #51 fixes this issue, current implementation is not perfect and professional.

That is because most part of this library uses unresolved (example: unresolved references) OpenAPI spec.

For particularly this issue we need resolved OpenAPI spec i.e. resolved references, resolved allOfs etc.

So to gain more concrete implementation, significant changes to this library might be required.

So first let

It is still possible to fix this issue without cebe/php-openapi#208 bieng merged, but that will be manual like done for example x-fk-on-delete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants