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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…