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

Implementing OpenAPI 3.1.0 spec #1513

Merged
merged 88 commits into from
Apr 5, 2023
Merged

Implementing OpenAPI 3.1.0 spec #1513

merged 88 commits into from
Apr 5, 2023

Conversation

Nerzal
Copy link
Contributor

@Nerzal Nerzal commented Mar 23, 2023

Describe the PR
This PR is still work in progress.

The PR makes use of this: spec library - https://github.com/sv-tools/openapi

What is done:

  1. Added a new CLI flag that tells the generator to use the new open api 3.1.0 specification
  2. Added parsing of GeneralAPI Info

Ongoing: Parsing of operations

Relation issue
#548

@Nerzal Nerzal marked this pull request as ready for review April 5, 2023 13:07
@Nerzal
Copy link
Contributor Author

Nerzal commented Apr 5, 2023

I'm able to generate a complete documentation of our real world API.
I'd say this is ready for a review and beta tests.

Known Issues:

  • Only application/json is supported as response data type right now. As it's hardcoded

Missing OpenAPI V3.1.0 features can be implemented after hunting down all possible bugs :)

@Nerzal
Copy link
Contributor Author

Nerzal commented Apr 5, 2023

@ubogdan can you tell my why the snyk test fails?
I'm not allowed to see the reason

Tobias Theel and others added 4 commits April 5, 2023 15:11
@Nerzal Nerzal changed the title WiP: Implementing OpenAPI 3.1.0 spec Implementing OpenAPI 3.1.0 spec Apr 5, 2023
@ubogdan
Copy link
Contributor

ubogdan commented Apr 5, 2023

@ubogdan can you tell my why the snyk test fails? I'm not allowed to see the reason

PR Check _ Snyk.pdf

@Nerzal Nerzal requested a review from ubogdan April 5, 2023 16:04
@ubogdan
Copy link
Contributor

ubogdan commented Apr 5, 2023

@Nerzal Thanks for your contribution and all the effort you made!

@ubogdan ubogdan merged commit 33441d9 into swaggo:v2 Apr 5, 2023
@Nerzal
Copy link
Contributor Author

Nerzal commented Apr 5, 2023

Nice, I still have some more days for Bugfixing and writing more tests and implementing new features.

So we should be able to get this to a production ready state pretty fast.

And all thanks go to ClariLab for granting the time needed for this

ubogdan pushed a commit that referenced this pull request Apr 5, 2023
* fix x-tagGroups

* fix module name

* change paths

* refactoring

* update dependencies

* stuff

* add log

* fix finding of main file

* fix broken type resolution

* fix bug

* clean deps

* fix tool after merging upstream

* use json-iterator to marshal json

* fix generating of json examples

* update config used by jsoniter

* bump version

* update dependencies

* resolve merge conflicts

* use newest go in docker

* yep

* fix gen

* fix gen

* update swag version

* yep

* fix parser

* fix some tests

* fix all tests

* parse most of general api description

* implement security scheme parsing

* parse oauth2 specs

* parse scopes and extensions in security schemes

* extend parsing security stuff

* process v3 routes

* meh

* find unimported types

* parse basic operation info

* parse primitive and object parameters

* generate openapi spec

* fix module name

* cleanup

* update version to 2.0

* fix issues that appread after merging

* cleanup after merge conflicts

* fix all tests

* add go 1.19 to workflows

* pin dockerfile to 1.19.7

* Set minimum supported Go version to 1.18.x

* parse response headers

* copy readme

* started to implement field parser

* Refactor: use RefOrSpec instead of Spec

* start to add tests for operationv3

* fix tests

* implement allOf with primitive types

* Add NestedPrimitiveArrayType test

* implement TestParseResponseCommentWithNestedFieldsV3

* add more tests

* parse arrays and maps

* fix implementation of map types

* implement more tests

* fix example docs

* adjust example

* fix example jsons

* support array types in Parameters

* implement more tests, implement correct collectionFormat handling

* finish implementation of operationv3 tests

* all tests green

* fix parsing of security definitions

* add test for generalAPI info

* end of day checkin

* Update example.json

* fix codeSamples from file and fix creation of operations

* fix resolving of schema ref errors

* fix tests that broke due to fixes on model parsing

* Fix creating schemes of array types of custom objects

* Fix resolution of refSchemas

* cleanup

* update dependencies

* cleanup

* Update README.md

reset readme.md

* Update README_zh-CN.md

reset readme_zh-CN

* update dependency

* reset test file

---------

Co-authored-by: Tobias Theel <[email protected]>
@joy4eg
Copy link

joy4eg commented Apr 12, 2023

@Nerzal That's a really cool thing! Thank you so much for your effort!

@Nerzal
Copy link
Contributor Author

Nerzal commented Apr 14, 2023

@joy4eg when the next PRs are merged this should be in a testable state

@ubogdan
Copy link
Contributor

ubogdan commented Apr 17, 2023

@Nerzal published rc1 version

ubogdan pushed a commit that referenced this pull request Apr 17, 2023
* fix x-tagGroups

* fix module name

* change paths

* refactoring

* update dependencies

* stuff

* add log

* fix finding of main file

* fix broken type resolution

* fix bug

* clean deps

* fix tool after merging upstream

* use json-iterator to marshal json

* fix generating of json examples

* update config used by jsoniter

* bump version

* update dependencies

* resolve merge conflicts

* use newest go in docker

* yep

* fix gen

* fix gen

* update swag version

* yep

* fix parser

* fix some tests

* fix all tests

* parse most of general api description

* implement security scheme parsing

* parse oauth2 specs

* parse scopes and extensions in security schemes

* extend parsing security stuff

* process v3 routes

* meh

* find unimported types

* parse basic operation info

* parse primitive and object parameters

* generate openapi spec

* fix module name

* cleanup

* update version to 2.0

* fix issues that appread after merging

* cleanup after merge conflicts

* fix all tests

* add go 1.19 to workflows

* pin dockerfile to 1.19.7

* Set minimum supported Go version to 1.18.x

* parse response headers

* copy readme

* started to implement field parser

* Refactor: use RefOrSpec instead of Spec

* start to add tests for operationv3

* fix tests

* implement allOf with primitive types

* Add NestedPrimitiveArrayType test

* implement TestParseResponseCommentWithNestedFieldsV3

* add more tests

* parse arrays and maps

* fix implementation of map types

* implement more tests

* fix example docs

* adjust example

* fix example jsons

* support array types in Parameters

* implement more tests, implement correct collectionFormat handling

* finish implementation of operationv3 tests

* all tests green

* fix parsing of security definitions

* add test for generalAPI info

* end of day checkin

* Update example.json

* fix codeSamples from file and fix creation of operations

* fix resolving of schema ref errors

* fix tests that broke due to fixes on model parsing

* Fix creating schemes of array types of custom objects

* Fix resolution of refSchemas

* cleanup

* update dependencies

* cleanup

* Update README.md

reset readme.md

* Update README_zh-CN.md

reset readme_zh-CN

* update dependency

* reset test file

---------

Co-authored-by: Tobias Theel <[email protected]>
ubogdan pushed a commit that referenced this pull request Apr 17, 2023
* fix x-tagGroups

* fix module name

* change paths

* refactoring

* update dependencies

* stuff

* add log

* fix finding of main file

* fix broken type resolution

* fix bug

* clean deps

* fix tool after merging upstream

* use json-iterator to marshal json

* fix generating of json examples

* update config used by jsoniter

* bump version

* update dependencies

* resolve merge conflicts

* use newest go in docker

* yep

* fix gen

* fix gen

* update swag version

* yep

* fix parser

* fix some tests

* fix all tests

* parse most of general api description

* implement security scheme parsing

* parse oauth2 specs

* parse scopes and extensions in security schemes

* extend parsing security stuff

* process v3 routes

* meh

* find unimported types

* parse basic operation info

* parse primitive and object parameters

* generate openapi spec

* fix module name

* cleanup

* update version to 2.0

* fix issues that appread after merging

* cleanup after merge conflicts

* fix all tests

* add go 1.19 to workflows

* pin dockerfile to 1.19.7

* Set minimum supported Go version to 1.18.x

* parse response headers

* copy readme

* started to implement field parser

* Refactor: use RefOrSpec instead of Spec

* start to add tests for operationv3

* fix tests

* implement allOf with primitive types

* Add NestedPrimitiveArrayType test

* implement TestParseResponseCommentWithNestedFieldsV3

* add more tests

* parse arrays and maps

* fix implementation of map types

* implement more tests

* fix example docs

* adjust example

* fix example jsons

* support array types in Parameters

* implement more tests, implement correct collectionFormat handling

* finish implementation of operationv3 tests

* all tests green

* fix parsing of security definitions

* add test for generalAPI info

* end of day checkin

* Update example.json

* fix codeSamples from file and fix creation of operations

* fix resolving of schema ref errors

* fix tests that broke due to fixes on model parsing

* Fix creating schemes of array types of custom objects

* Fix resolution of refSchemas

* cleanup

* update dependencies

* cleanup

* Update README.md

reset readme.md

* Update README_zh-CN.md

reset readme_zh-CN

* update dependency

* reset test file

---------

Co-authored-by: Tobias Theel <[email protected]>
@darakanoit
Copy link

Are there any updates?
I have a problem with the fact that my other service only accepts open api 3.0 and I have to convert 2.0 to 3.0 myself before pushing

@ubogdan
Copy link
Contributor

ubogdan commented Feb 1, 2024

@darakanoit, this is an Open Source project. Please feel free to contribute, and we will be more than happy to assist you with CR to get this feature launched.

@Xantios
Copy link

Xantios commented May 15, 2024

What needs being done on this PR to get it merged? If there is anything i can do to contribute i'd love to make this happen.

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

Successfully merging this pull request may close these issues.

None yet

5 participants