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

rororo doesn't seem to work on vc-http-api.yml https://w3c-ccg.github.io/vc-http-api/ #159

Open
daidoji opened this issue Mar 3, 2021 · 3 comments
Assignees
Labels
bug Something isn’t working openapi Issue or pull request related to OpenAPI code
Milestone

Comments

@daidoji
Copy link

daidoji commented Mar 3, 2021

There seem to be quite a few errors so I won't go into much detail. However, I noticed that if I take the schema above and the example json (copy pasted from /credentials/issue endpoint in that url) using the curl command I get the following error.

daidoji@worklaptop:~/TrustScience/vc-http-api/pcurl -i -H "Accept: application/json" -H "Content-Type: application/json" -X POST --data @bar.json http://localhost:8080/credentials/issue
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json; charset=utf-8
Content-Length: 109
Date: Tue, 02 Mar 2021 22:27:06 GMT
Server: Python/3.9 aiohttp/3.6.3

{"detail": [{"loc": ["body", "credential", "issuer"], "message": "'did:example:123' is not of type object"}]}

However, you'll see in the yaml that body/credential/issuer can be:

    Issuer:
      type: object
      description: A JSON-LD Verifiable Credential Issuer.
      oneOf:
        - type: string
        - type: object
          properties:
            id:
              type: string
      example:
        { "id": "did:key:z6MkjRagNiMu91DduvCvgEsqLZDVzrJzFrwahc4tXLt9DoHd" }

So I should be able to pass an json object of type object with a property of id or a string directly. This seems like a bug in rororo because if I remove the oneOf section and chance the type of the Issuer spec to string directly then the curl command works.

@playpauseandstop playpauseandstop self-assigned this May 1, 2021
@playpauseandstop playpauseandstop added bug Something isn’t working openapi Issue or pull request related to OpenAPI code labels May 1, 2021
@playpauseandstop playpauseandstop added this to the 2.3 milestone May 1, 2021
@playpauseandstop playpauseandstop modified the milestones: 2.3, 3.0 Nov 6, 2021
@playpauseandstop playpauseandstop modified the milestones: 3.0, 4.0 Aug 9, 2022
@playpauseandstop
Copy link
Owner

The repo has been moved to: https://github.com/w3c-ccg/vc-api/

The latest schema: vc-api-2023-05-28-22-47.zip

playpauseandstop added a commit that referenced this issue May 28, 2023
Ensure that oneOf schemas been supported in `rororo` library.

Fixes: #159
@playpauseandstop
Copy link
Owner

Been able to reproduce the error in #363, next will try to dig deeper and decide whether it is possible to properly support oneOf schema definitions with ancient openapi-core version that been used by rororo or is it needed to update to latest openapi-core.

Maybe related: #149

@playpauseandstop
Copy link
Owner

@daidoji

I am able to reproduce error and "cover" it with test case in #363, but cannot fix it with currently supported version of openapi-core>=0.13.4,<0.13.7. However, as latest openapi-core version is 0.17.1, I hope the error will gone after #149 will be implemented.

Hope next update on a topic will be available soon.

playpauseandstop added a commit that referenced this issue May 29, 2023
… test (#363)

With `openapi-core>=0.13.4,<0.13.7` it is impossible to support
following **valid** schema of,

```
Component:
  type: "object"
  oneOf:
    - type: "string"
    - type: "object"
      ...
```

as it does not negate global `type: "object"`, when resolves inner `type:
"string"`.

Cause of that provide a test, but mark it as XFAIL, and hopefully the problem
will gone with migration to latest `openapi-core` 🤔

Issue: #159
Related: #149
badabump-release-bot bot pushed a commit that referenced this issue May 29, 2023
Features:
---------

- Ensure support of `environ-config@^23.2.0` (#360)

Fixes:
------

- (**settings**) Ensure `setup_settings_from_environ` function works well (#361)
- [#191] (**openapi**) Do not handle redirection errors (#362)

Other:
------

- Monthly maintenance (Jan 2023) (#314)
- Bump dev Python version to 3.11.2 (#326)
- (**deps**) bump actions/checkout from 3.2.0 to 3.3.0 (#323)
- (**deps-dev**) bump redis from 4.5.1 to 4.5.3 (#328)
- (**deps-dev**) bump types-redis from 4.5.1.3 to 4.5.3.0 (#329)
- (**deps**) bump requests from 2.28.2 to 2.31.0 (#353)
- (**deps**) bump attrs from 22.2.0 to 23.1.0 (#349)
- Bump dev Python version to 3.11.3 (#359)
- (**deps**) bump actions/checkout from 3.3.0 to 3.5.2 (#352)
- (**deps**) bump email-validator from 1.3.1 to 2.0.0.post2 (#346)
- (**deps-dev**) bump mypy from 1.0.1 to 1.3.0 (#357)
- (**deps-dev**) bump redis from 4.5.3 to 4.5.4 (#330)
- (**deps-dev**) bump pytest from 7.2.1 to 7.3.1 (#347)
- (**deps-dev**) bump pytest-asyncio from 0.20.3 to 0.21.0 (#336)
- (**deps-dev**) bump types-pyyaml from 6.0.12.8 to 6.0.12.10 (#358)
- (**deps-dev**) bump types-redis from 4.5.3.0 to 4.5.5.2 (#356)
- (**deps-dev**) bump furo from 2022.12.7 to 2023.3.27 (#332)
- (**deps-dev**) bump sphinx-copybutton from 0.5.1 to 0.5.2 (#344)
- (**deps-dev**) bump sphinx-autodoc-typehints from 1.22 to 1.23.0 (#345)
- [#159] (**openapi**) Cover oneOf schema from Verifiable Credential API with test (#363)
playpauseandstop added a commit that referenced this issue May 29, 2023
The latest _rororo_ version allows to install library alongside latest version
of `attrs` & `email-validator` and **require** latest `environ-config`
version. On top of that `rororo==3.2.0` ensure that `web.HTTPRedirection`
errors will not handled by error middleware and will result in proper redirects.

Features:
---------

- Ensure support of `environ-config@^23.2.0` (#360)

Fixes:
------

- (**settings**) Ensure `setup_settings_from_environ` function works well (#361)
- [#191] (**openapi**) Do not handle redirection errors (#362)

Other:
------

- Monthly maintenance (Jan 2023) (#314)
- Bump dev Python version to 3.11.2 (#326)
- (**deps**) bump actions/checkout from 3.2.0 to 3.3.0 (#323)
- (**deps-dev**) bump redis from 4.5.1 to 4.5.3 (#328)
- (**deps-dev**) bump types-redis from 4.5.1.3 to 4.5.3.0 (#329)
- (**deps**) bump requests from 2.28.2 to 2.31.0 (#353)
- (**deps**) bump attrs from 22.2.0 to 23.1.0 (#349)
- Bump dev Python version to 3.11.3 (#359)
- (**deps**) bump actions/checkout from 3.3.0 to 3.5.2 (#352)
- (**deps**) bump email-validator from 1.3.1 to 2.0.0.post2 (#346)
- (**deps-dev**) bump mypy from 1.0.1 to 1.3.0 (#357)
- (**deps-dev**) bump redis from 4.5.3 to 4.5.4 (#330)
- (**deps-dev**) bump pytest from 7.2.1 to 7.3.1 (#347)
- (**deps-dev**) bump pytest-asyncio from 0.20.3 to 0.21.0 (#336)
- (**deps-dev**) bump types-pyyaml from 6.0.12.8 to 6.0.12.10 (#358)
- (**deps-dev**) bump types-redis from 4.5.3.0 to 4.5.5.2 (#356)
- (**deps-dev**) bump furo from 2022.12.7 to 2023.3.27 (#332)
- (**deps-dev**) bump sphinx-copybutton from 0.5.1 to 0.5.2 (#344)
- (**deps-dev**) bump sphinx-autodoc-typehints from 1.22 to 1.23.0 (#345)
- [#159] (**openapi**) Cover oneOf schema from Verifiable Credential API with test (#363)

Co-authored-by: playpauseandstop <playpauseandstop@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working openapi Issue or pull request related to OpenAPI code
Projects
None yet
Development

No branches or pull requests

2 participants