Skip to content
This repository has been archived by the owner on Jul 2, 2019. It is now read-only.

Plans for OpenAPI 3.0 support? #131

Closed
hgmich opened this issue Sep 12, 2017 · 11 comments
Closed

Plans for OpenAPI 3.0 support? #131

hgmich opened this issue Sep 12, 2017 · 11 comments

Comments

@hgmich
Copy link

hgmich commented Sep 12, 2017

Hi,

We were hoping to leverage Dredd in a project spec'd by OpenAPI 3.0 but it seems that this adapter for Swagger schemas is 2.0 only. Are there any current plans to add support or create a fork for OpenAPI 3.0 support?

@phal0r
Copy link

phal0r commented Jul 31, 2018

It seems that parsing is done with swagger-parser. According to their docs (https://github.com/BigstickCarpet/swagger-parser#features) they support Open API 3 in version 5 (at least). This adapter uses version 3. Greenkeeper tried to build it, but failed -> #194

So there seem to be some breaking changes in the api.

@phal0r
Copy link

phal0r commented Jul 31, 2018

I checked the Breaking Changes between v3 and v4 of swagger-parser and changed https://github.com/apiaryio/fury-adapter-swagger/blob/master/src/parser.js#L107 from $refs to external to comply with the new options. This fixed one test, but 2 more are failing. Regarding these tests:

The failing test are checking this schema: https://github.com/apiaryio/swagger-zoo/blob/master/fixtures/features/swagger/path-reference-typo.yaml

It contains a wrong $ref and the expected error message differs now. Expected is:
https://github.com/apiaryio/swagger-zoo/blob/master/fixtures/features/api-elements/path-reference-typo.json#L64

I get a similar error with the exception that a whole file path is included instead of only the fragment #/definitions/Whoops. I have no idea what the fixture format is about, but it may be useful for someone else to get this going.

@kylef
Copy link
Member

kylef commented Jul 31, 2018

@phal0r Upgrading swagger-parser is being tackled in #158 I believe APIDevTools/json-schema-ref-parser#80 is required to finish this. Although, [email protected] depends on [email protected] which has some licensing problems which will ultimately block upgrading that dependency. The package.json declares the license is ISC however in the README it says the license is MIT. There is no license file and thus no copyright notice.

$ ls
README.md	bower.json	package.json	schema.json

$ grep license package.json
  "license": "ISC",

$ grep -A 2 License README.md
## License

 MIT

That said, this adapter will not be responsible for OAS3 parsing. That will be handled in a separate Fury adapter for OAS3 specifically. The architecture of that adapter will likely be different from fury-adapter-swagger.

@phal0r
Copy link

phal0r commented Aug 11, 2018

@kylef Ok, thanks for pointing this out. Has there any work already be done somewhere to follow and maybe help building this?

@nickrivadeneira
Copy link

nickrivadeneira commented Nov 2, 2018

@kylef Also interested. Is there anywhere we can contribute or track progress to a Fury adapter for OAS3? My understanding from this thread and @honzajavorek's comments is that the @apiaryio/adt team is on it.

@honzajavorek
Copy link
Contributor

@nickrivadeneira We're in preparations of the initial scaffolding and architecture of the adapter. Once that's ready, we plan to continue development publicly to allow contributions and cheering crowds. We'll get back in a moment, stay tuned!

@juliuszfedyk
Copy link

juliuszfedyk commented Dec 5, 2018

Hey @honzajavorek any news? I would love to help as well!

@honzajavorek
Copy link
Contributor

@juliuszfedyk We're in the process of turning the api-elements.js into a monorepo and the OAS3 adapter stub should soon appear there.

@kylef
Copy link
Member

kylef commented Jan 18, 2019

fury-adapter-oas3-parser 0.3.0 is now available. The parser is in early stages so check out the status page to track the current supported functionality. The source is found at https://github.com/apiaryio/api-elements.js/tree/master/packages/fury-adapter-oas3-parser.

@kylef kylef closed this as completed Jan 18, 2019
@nickrivadeneira
Copy link

nickrivadeneira commented Jan 18, 2019

Awesome news, thanks for the update!

@honzajavorek
Copy link
Contributor

Experimental OpenAPI 3 support is now available in Dredd v7.1.0 🎉 You can try it out following the examples in apiaryio/api-elements.js#71

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants