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

[need] Add nullable property to openapi.yml #668

Open
1 task done
liverocaisson opened this issue May 15, 2023 · 5 comments
Open
1 task done

[need] Add nullable property to openapi.yml #668

liverocaisson opened this issue May 15, 2023 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@liverocaisson
Copy link
Contributor

liverocaisson commented May 15, 2023

Scribe version

4.19.1

Your question

First, thank you for maintaining scribe.

The generated openapi.yml is not usable in swagger or spotlight if there's a property with null value.
Those properties are reported as errors.

スクリーンショット 2023-05-15 9 59 55

OpenAPI v3 allow to use null value by adding the property "nullable".

https://stackoverflow.com/questions/48111459/how-to-define-a-property-that-can-be-string-or-null-in-openapi-swagger

As suggested bellow:

type: string
nullable: true

If we use nullable property, the error is resolved.

It would be very useful if we can set properties as nullable in the specification of parameters with Scribe.
https://scribe.knuckles.wtf/laravel/documenting/query-body-parameters

Thank you.

Docs

@liverocaisson liverocaisson added question Further information is requested triage labels May 15, 2023
@liverocaisson liverocaisson changed the title [need] openapi.yml is not correct. Is it possible to add nullable to property [need] Add nullable to property to openapi.yml May 15, 2023
@liverocaisson liverocaisson changed the title [need] Add nullable to property to openapi.yml [need] Add nullable property to openapi.yml May 15, 2023
@shalvah shalvah removed the triage label Jun 30, 2023
@shalvah
Copy link
Contributor

shalvah commented Jun 30, 2023

Sure, can you send in a PR for this?

@shalvah shalvah added the enhancement New feature or request label Jun 30, 2023
@NoahNxT
Copy link

NoahNxT commented Sep 27, 2023

@liverocaisson Any updates on a PR?

@liverocaisson
Copy link
Contributor Author

Actually I don't know how to implement it in Scribe

@shalvah shalvah added the help wanted Extra attention is needed label Sep 29, 2023
@shalvah
Copy link
Contributor

shalvah commented Sep 29, 2023

How far did you go, though? The Scribe codebase isn't difficult to get started with (some parts are tricky, yes, but the OpenAPISpecWriter is one of the more straightforward parts).

@liverocaisson
Copy link
Contributor Author

Thank you for your comment with the hint about where to modify it.

@shalvah @NoahNxT

I tried to modify the OpenAPISpecWriter here the PR
#739

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants