Giter Club home page Giter Club logo

Comments (14)

seriousme avatar seriousme commented on May 24, 2024 1

Correct, that also surprised me ;-)
It takes the openApi version from: https://api.apis.guru/v2/list.json

  "x-providerName": "discourse.local"
        },
        "updated": "2023-03-06T07:12:59.965Z",
        "swaggerUrl": "https://api.apis.guru/v2/specs/discourse.local/latest/openapi.json",
        "swaggerYamlUrl": "https://api.apis.guru/v2/specs/discourse.local/latest/openapi.yaml",
        "openapiVer": "3.0.3"

Maybe I should have my script double check that ;-)

Kind regards,
Hans

from openapi-schema-validator.

MikeRalphson avatar MikeRalphson commented on May 24, 2024 1

And I've fixed the bug and incorrect metadata on my side.

from openapi-schema-validator.

MikeRalphson avatar MikeRalphson commented on May 24, 2024 1

See OAI/OpenAPI-Specification#3235

from openapi-schema-validator.

seriousme avatar seriousme commented on May 24, 2024 1

As soon as the new version is available I will publish a new release. Good to see you fixed it at the source 👍

from openapi-schema-validator.

seriousme avatar seriousme commented on May 24, 2024

Hi,

I did some research:

There has apparantly been a change between 3.0 and 3.1 of the specification:
3.0 describes it as:

"Server": {
"type": "object",
"required": [
"url"
],
"properties": {
"url": {
"type": "string"
},

See also: https://spec.openapis.org/oas/v3.0.3#server-object

3.1 describes it as :

"server": {
"$comment": "https://spec.openapis.org/oas/v3.1.0#server-object",
"type": "object",
"properties": {
"url": {
"type": "string",
"format": "uri-reference"
},

See also: https://spec.openapis.org/oas/v3.1.0#server-object

It seems like the OpenAPI team have decided to apply more strict rules on this object.

And since the spec at https://github.com/APIs-guru/openapi-directory/blob/main/APIs/discourse.local/latest/openapi.yaml starts with openapi: 3.1.0 the test script applies the 3.1 schema.

Looking at the 'blame' of the 3.1 schema: https://github.com/OAI/OpenAPI-Specification/blame/main/schemas/v3.1/schema.json#L171

it seems that this tightening of the rules was introduced by: OAI/OpenAPI-Specification#2586

Hope this helps !

Kind regards,
Hans

from openapi-schema-validator.

MikeRalphson avatar MikeRalphson commented on May 24, 2024

Thanks. failed.md states it is OAS 3.0.3 though...

from openapi-schema-validator.

seriousme avatar seriousme commented on May 24, 2024

Ok, just updated my script. It now doesn't take the openapiVer from https://api.apis.guru/v2/list.json anymore but reads the version from the file.

Hope this reduces confusion ;-)

Kind regards,
Hans

from openapi-schema-validator.

github-actions avatar github-actions commented on May 24, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days'

from openapi-schema-validator.

github-actions avatar github-actions commented on May 24, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days'

from openapi-schema-validator.

github-actions avatar github-actions commented on May 24, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days'

from openapi-schema-validator.

nielthiart avatar nielthiart commented on May 24, 2024

A fix for this validation issue was merged two weeks ago, but is yet to be released. This repository builds on the gh-pages branch of OAS instead of main.

from openapi-schema-validator.

seriousme avatar seriousme commented on May 24, 2024

@nielthiart thanks for the tip!

Good to see this one has been adressed. Unfortunately it looks like the YAML file and the JSON file are modified by different PR's so its unclear to me if they represent the same data, can you confirm ?
(I converted the YAML to JSON and ran a diff and got some differences, not sure if they are semanticly different)

The header is still:
`"$id": "https://spec.openapis.org/oas/3.1/schema/2022-10-07",
is this correct?

Kind regards,
Hans

from openapi-schema-validator.

nielthiart avatar nielthiart commented on May 24, 2024

Hi Hans, yes it looks like the spec ID hasn't changed, so this update isn't released yet.

In the meanwhile, would you consider accepting a PR that brings this validation library in line with the specification, similar to how you currently replace $dynamicRefs by normal $refs?

The OAS project reminds validation libraries to treat the released text Specification as authoritative in the case of conflicts with the JSON schema:

As a reminder, the JSON Schema is not the source of truth for the Specification. In cases of conflicts between the Specification itself and the JSON Schema, the Specification wins.

The text Specification allows unformatted strings in server URLs, which would validate URLs with template strings in.

from openapi-schema-validator.

seriousme avatar seriousme commented on May 24, 2024

Niel,

I'd rather wait for the official release as it seems nearly ready.
By making a separate copy we might get challenges when other official schema spec changes are released.

If you want to speed things up then getting OAS to publish their new schema seems the best course of action to me.

Kind regards,
Hans

from openapi-schema-validator.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.