Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
428 views
in Technique[技术] by (71.8m points)

spring boot - how to handle AWS API gateway for API versions with swagger json in springboot

We have CICD using cloud formation scripts we build infra and deploy API. Jenkins file script:

Step 1: our swagger will create swagger docs. this will be stored in S3 bucket

sh "curl https://{host-name}/v2/api-docs?group=school-api-v1.0 -o ${WORKSPACE}/devl-schoolapi-doc.json"

Step 2: sh "aws apigateway put-rest-api --rest-api-id ${env.API_ID} --mode overwrite --body 'file://${WORKSPACE}/devl-schoolapi-doc.json' --region us-east-1"

Step 3: sh "aws apigateway create-deployment --rest-api-id ${env.API_ID} --stage-name ${env.ENVIRONMENT} --region us-east-1 "}

This will build on AWS env Gateway with v1/ endpoint for resources. Gateway view

Now I want to maintain two API versions in this gateway for the below methods.

1./student
2./v1/student

In my api two swagger json are getting produce. As this is minor version it should have same endpoints

1.https://{host-name}/v2/api-docs?group=school-api-v1.0
2.https://{host-name}/v2/api-docs?group=school-api-v1.1

Currently with my scripts its showing only the v1.0 version in gateway

question from:https://stackoverflow.com/questions/65936074/how-to-handle-aws-api-gateway-for-api-versions-with-swagger-json-in-springboot

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...