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

Scalar theme doesn't use data from ResponseField attribute. #921

Open
1 task done
ravibpatel opened this issue Nov 26, 2024 · 3 comments
Open
1 task done

Scalar theme doesn't use data from ResponseField attribute. #921

ravibpatel opened this issue Nov 26, 2024 · 3 comments
Labels
bug Something isn't working triage

Comments

@ravibpatel
Copy link

Scribe version

4.38.0

PHP version

8.3

Framework

Laravel

Framework version

11.33.2

Scribe config

type => "laravel"
auth.enabled => true
auth.default => true
auth.name => "Authorization"
examples.faker_seed => 2
strategies.bodyParameters => added App\GetFromFormRequest: removed Knuckles\Scribe\Extracting\Strategies\BodyParameters\GetFromFormRequest

What happened?

When using "scalar" theme with "external_laravel" type, it doesn't populate the values from ResponseField attribute in the docs. It works fine with default theme.

Docs

@ravibpatel ravibpatel added bug Something isn't working triage labels Nov 26, 2024
@shalvah
Copy link
Contributor

shalvah commented Nov 29, 2024

Does the data show up in the generated OpenAPI spec though? Because the data that shows up in the external_* themes is an external JS library (eg Scalar) which takes the OpenAPI spec. So if it's in the OpenAPI spec but not rendered by the external library, it's not on us.

@ravibpatel
Copy link
Author

I checked the OpenAPI spec, and it has the response fields for some of the endpoints, but not for others. Those who have the response fields does show up in scalar.

@ravibpatel
Copy link
Author

It seems it is calling the setDescription method using the full path here and that is causing the issue. I have added ResponseField attribute to ApiResource with id as the name as mentioned here, but it is looking for data.id.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

2 participants