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

value?.ref?.split is not a function when using the validate command #1187

Closed
antoinebidault opened this issue Mar 4, 2025 · 3 comments · Fixed by #1189
Closed

value?.ref?.split is not a function when using the validate command #1187

antoinebidault opened this issue Mar 4, 2025 · 3 comments · Fixed by #1189
Labels
bug Something isn't working command:openapi Issues pertaining to the `openapi`, `validate`, `reduce`, or `swagger` commands

Comments

@antoinebidault
Copy link

Hi,
Since updating the CLI to v10, my OpenAPI specs fail to validate from this URL:
🔗 https://api.dastra.eu/api/v1/dastra.json

This worked fine in v9.0.5, and manually uploading the specs to the dashboard still works.

Steps to Reproduce
Installation method: npm i rdme -g
Specs validation : rdme openapi validate https://api.dastra.eu/api/v1/dastra.json
Screenshot of the issue:
Image
It seems to be related to the ref parser lib

Environment
Node version : 22.11.0
Npm version : 10.9.0

@m1k3lm
Copy link

m1k3lm commented Mar 5, 2025

Hi,

We're encountering the same error with our schemas. What's particularly strange is that the issue appears inconsistently—some machines experience it while others do not, despite using the same Node, npm, and rdme versions. We were able to reproduce the same behavior with both your OpenAPI file and ours.

To further investigate, we tested using the official Docker images, and the validation error persists across versions:

  • With the latest rdme:
    docker run --rm node:22 sh -c "npx rdme openapi:validate https://api.dastra.eu/api/v1/dastra.json"
  • Even with rdme 9.0.5:
    docker run --rm node:22 sh -c "npx rdme@9.0.5 openapi:validate https://api.dastra.eu/api/v1/dastra.json"
  • Testing with an updated npm version:
    docker run --rm node:22 sh -c "npm install -g npm@11.1.0 && npx rdme@9.0.5 openapi:validate https://api.dastra.eu/api/v1/dastra.json"
  • And with the latest npm:
    docker run --rm node sh -c "npm install -g npm@11.1.0 && npx rdme openapi:validate https://api.dastra.eu/api/v1/dastra.json"

Additionally, we noticed this deprecation warning, which might be related:

npm WARN deprecated @readme/json-schema-ref-parser@1.2.1: This package is no longer maintained. Please use @apidevtools/json-schema-ref-parser instead.

For reference, here's one of our openapi.json.

Let us know if you find any further insights!

@m1k3lm
Copy link

m1k3lm commented Mar 6, 2025

It seems that this will be fixed in the 10.2 version.

docker run --rm node sh -c "npx rdme@10.2.0-next.5 openapi:validate https://api.dastra.eu/api/v1/dastra.json" 

returns

@kanadgupta kanadgupta added command:openapi Issues pertaining to the `openapi`, `validate`, `reduce`, or `swagger` commands bug Something isn't working labels Mar 7, 2025
@kanadgupta
Copy link
Member

Hi folks! We've been overhauling our OpenAPI / JSON schema parsing and the changes landed in #1189. It looks like @m1k3lm confirmed that the issue is fixed in rdme@10.2.0-next.5 (npm release, GitHub release). Please upgrade to this version in the meantime. A release on the latest channel with this fix should be available soon.

I'll close this out now but please reach out if you see any other issues. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working command:openapi Issues pertaining to the `openapi`, `validate`, `reduce`, or `swagger` commands
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants