interagent / interagent/committee

problem with oneOf: string/integer

Open
#286 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
955
Forks
145
Avg merge
5d 4h
Merged PRs (30d)
6

Description

I have added a rails application here that illustrates the problem: https://github.com/jcoyne/comittee-bug

It has a failing test which you can run by doing:

bundle exec rspec spec/requests/resources_request_spec.rb

Committee reports{"id":"bad_request","message":"7116 isn't one of in #/components/schemas/Title/properties/value"}

I believe this is because of: https://github.com/jcoyne/comittee-bug/blob/master/openapi.yml#L32-L34

If I comment out the line:

          - type: integer

then it works fine.

If I change this line of the test:

https://github.com/jcoyne/comittee-bug/blob/master/spec/requests/resources_request_spec.rb#L6

to look like a string, e.g. ({ "title":{"value":"Number 7116"}}) it also works fine.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked reproduction's openapi.yml lines 32-34 and run bundle exec rspec spec/requests/resources_request_spec.rb. Compare the integer and string cases described in the issue and trace how Committee validates the oneOf schema. Done means the failing request passes while both string and integer values remain accepted.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, rails, ruby
Domain
backend-api-design, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.