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

action_text_value property type must be object,null #74

Closed
jagthedrummer opened this issue Nov 17, 2023 · 1 comment · Fixed by bullet-train-co/bullet_train-core#681
Closed

Comments

@jagthedrummer
Copy link
Contributor

I'm working on setting up this repo to run tests against the Bullet Train starter repo and in the process I've discovered that v2.6.4 of this gem is causing errors in the starter repo.

There are several errors like this:

[2] tmp/openapi.yaml:1650:38 at #/paths/~1scaffolding~1absolutely_abstract~1creative_concepts~1{absolutely_abstract_creative_concept_id}~1completely_concrete~1tangible_things/get/responses/200/content/application~1json/example/0/action_text_value

Example value must conform to the schema: `action_text_value` property type must be object,null.

1648 | super_select_value: three
1649 | text_area_value: MyText
1650 | action_text_value: MyText
1651 | created_at: '2023-01-01T00:00:00.000Z'
1652 | updated_at: '2023-01-02T00:00:00.000Z'

referenced from tmp/openapi.yaml:1630:15 at #/paths/~1scaffolding~1absolutely_abstract~1creative_concepts~1{absolutely_abstract_creative_concept_id}~1completely_concrete~1tangible_things/get/responses/200/content/application~1json 

Warning was generated by the no-invalid-media-type-examples rule.

And one like this (which might be normal?):

[1] tmp/openapi.yaml:11:10 at #/servers/0/url

Server `url` should not point to example.com or localhost.

 9 |   version: "V1"
10 | servers:
11 |   - url: http://localhost:3001/api/v1
12 | components:
13 |   securitySchemes:

Warning was generated by the no-server-example.com rule.

You can see a failing run here: https://github.com/bullet-train-co/jbuilder-schema/actions/runs/6907378005/job/18795175127#step:18:53

@newstler
Copy link
Contributor

newstler commented Nov 17, 2023

@jagthedrummer For the first warning, there is an issue in Jbuilder, that unlike ERB, which calls to_s on ActionText objects, it doesn't do it and parses the whole object as it is.

We already monkey patch Jbuilder to return us strings instead of objects for ActionTexts, but it didn't work for Jbuilder::Schema, as it also overwrites Jbuilder methods. Here I added a PR which patches Jbuilder::Schema the same way, I think with it these errors should go.

--

I tried to avoid parsing ActionText in Jbuilder::Schema directly to mimic the original Jbuilder behaviour.
Thinking on how to update Jbuilder better, because also want to avoid adding dependencies.

--

Not sure where does second issue come from, will check.

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