server icon indicating copy to clipboard operation
server copied to clipboard

vault-management-api.json validation error

Open cdman opened this issue 1 year ago • 2 comments

Steps To Reproduce

  1. Download the vault-management-api.json from https://bitwarden.com/help/vault-management-api/ (scroll down all the way to the bottom and click on "Download Swagger JSON file")
  2. Try to validate it using https://www.openapi4j.org/ (one of the libraries recommended by the official OpenAPIs site, which this file purports to follow: https://tools.openapis.org/categories/schema-validators.html)

Expected Result

The file to pass validation.

Actual Result

Validation error(s) :
paths./object/item.post.requestBody.content.application/json.schema.properties.type.type: String value 'int' does not match required pattern 'boolean|object|array|number|integer|string'. (code: 106)
From: paths./object/item.post.requestBody.content.application/json.schema.properties.type.type
components.schemas.item.template.properties.type.type: String value 'int' does not match required pattern 'boolean|object|array|number|integer|string'. (code: 106)
From: components.schemas.item.template.properties.type.type

Screenshots or Videos

No response

Additional Context

The error can be fixed by replacing "type":"int" with "type":"integer" in the only place where it occurs.

Build Version

latest

Environment

Cloud (bitwarden.com)

Environment Details

No response

Issue Tracking Info

  • [X] I understand that work is tracked outside of Github. A PR will be linked to this issue should one be opened to address it, but Bitwarden doesn't use fields like "assigned", "milestone", or "project" to track progress.

cdman avatar May 31 '24 01:05 cdman

Hi there,

Thank you for your report!

I was able to reproduce this issue, and I have flagged this to our engineering team.

If you wish to add any further information/screenshots/recordings etc., please feel free to do so at any time - our engineering team will be happy to review these.

Thanks once again!

sammbw avatar May 31 '24 02:05 sammbw

FYI, there are some more issues with the json file. Take a look at the .patch files here to see what needs to be changed for the .json file to be valid: https://gitlab.com/grey-panther/py-bw-vault-api-unofficial/-/tree/main/openapi-definition?ref_type=heads

cdman avatar Jul 18 '24 10:07 cdman

We would love to try to solve the additional issues from: https://gitlab.com/grey-panther/py-bw-vault-api-unofficial/-/tree/main/openapi-definition?ref_type=heads (the integer problem seemed to have been solved), but I cannot find where to alter the json anywhere in this github repo. Is there some place @sammbw can point my group and I to? A different repo or what file exactly controls the swagger configs?

BensonB12 avatar Oct 23 '24 21:10 BensonB12