-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Supprt OpenAPI Specification Version 3.0.2 #386
Comments
Do you know good openapi v3 spec library for |
kin-openapi ,is it okay? |
It does not look like go-openapi/spec#21
Not supporting openapi 3 makes impossible to document APIs that could otherwise be documented with swag (e.g., when using |
Hi guys, |
I've worked around this with some Make targets The first runs The second mounts that folder and generates a v3 folder with openapi-generator-cli
Makefile # Docker image to run shell and go utility functions in
WORKER_IMAGE = golang:1.15-alpine3.13
# Docker image to generate OAS3 specs
OAS3_GENERATOR_DOCKER_IMAGE = openapitools/openapi-generator-cli:latest-release
.PHONY: ci-swaggen2
ci-swaggen2:
@docker run --rm -v $(PWD):/work $(WORKER_IMAGE) \
sh -c "apk update && apk add --no-cache git; go get -u github.com/swaggo/swag/cmd/swag && (cd /work; swag init)"
# Generate OAS3 from swaggo/swag output since that project doesn't support it
# TODO: Remove this if V3 spec is ever returned from that project
.PHONY: ci-swaggen
ci-swaggen: ci-swaggen2
@echo "[OAS3] Converting Swagger 2-to-3 (yaml)"
@docker run --rm -v $(PWD)/docs:/work $(OAS3_GENERATOR_DOCKER_IMAGE) \
generate -i /work/swagger.yaml -o /work/v3 -g openapi-yaml --minimal-update
@docker run --rm -v $(PWD)/docs/v3:/work $(WORKER_IMAGE) \
sh -c "rm -rf /work/.openapi-generator"
@echo "[OAS3] Copying openapi-generator-ignore (json)"
@docker run --rm -v $(PWD)/docs/v3:/work $(WORKER_IMAGE) \
sh -c "cp -f /work/.openapi-generator-ignore /work/openapi"
@echo "[OAS3] Converting Swagger 2-to-3 (json)"
@docker run --rm -v $(PWD)/docs:/work $(OAS3_GENERATOR_DOCKER_IMAGE) \
generate -s -i /work/swagger.json -o /work/v3/openapi -g openapi --minimal-update
@echo "[OAS3] Cleaning up generated files"
@docker run --rm -v $(PWD)/docs/v3:/work $(WORKER_IMAGE) \
sh -c "mv -f /work/openapi/openapi.json /work ; mv -f /work/openapi/openapi.yaml /work ; rm -rf /work/openapi" Run |
Excuse me, I don't understand how to use it, would you like to help me ? |
@lifegit Create a Makefile with that content, and run the command I mentioned |
@OneCricketeer |
uppppppppppppppppppp |
how about this lib https://github.com/getkin/kin-openapi |
@hotrungnhan What about it? It was already mentioned in the third comment |
oh im sorry i did't read thi third comment. |
Any update? |
The easiest way is using the swagger editor. You just need to import your swagger.json file and convert to openapi 3. |
How can I automate that to automatically publish an up to date swagger spec with every nighly build of my software? |
I'm confused - I thought this PR #1513 adds support for OpenAPI spec version 3.x? But I don't see the CLI option |
Compile the latest release by yourself and you'll see it. |
The v3.1.0 implementation still has some bugs that need to be fixed |
Looking forward to the 3.1.0 support as well ^-^ |
Hoping we will get 3.1.0 support 🤞 |
Hi! What is the status of this issue? Is there a chance that we will get 3.1.0 support any time soon? |
Is your feature request related to a problem? Please describe.
Not support OAS version 3.0.2
Describe the solution you'd like
feature support OAS version 3.0.2
The text was updated successfully, but these errors were encountered: