mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-06 18:45:23 +00:00
ecf924e78f
* Adds Valid annotation for request body (#4847) If useBeanValidation is active, this change will add Valid annotation to ReqeustBody * Adds generated samples for bean vaildation in spring boot (#4847) * Adds feature option (#3819) When you enable the feature useOptional the JavaSpring generator will use type Optional for non required parameters. * Adds generated sample for #3819 * Adds generated sample for #3819 * Reverts commit for bean validation * Adds generated sample for #3819 * Reverts commit for bean validation * Fix alignment * update spring samples * update pom.xml to include spring use optional samples * update artifactId to "spring-boot-beanvalidation" * rpelace tab with 4-space * check mvn task result
50 lines
2.3 KiB
YAML
50 lines
2.3 KiB
YAML
# Java-related client, server tests
|
|
machine:
|
|
java:
|
|
version: openjdk8
|
|
services:
|
|
- docker
|
|
# Override /etc/hosts
|
|
hosts:
|
|
petstore.swagger.io: 127.0.0.1
|
|
environment:
|
|
DOCKER_GENERATOR_IMAGE_NAME: swaggerapi/swagger-generator
|
|
DOCKER_CODEGEN_CLI_IMAGE_NAME: swaggerapi/swagger-codegen-cli
|
|
|
|
dependencies:
|
|
cache_directories:
|
|
- "~/.m2"
|
|
- "~/.sbt"
|
|
|
|
pre:
|
|
- sudo add-apt-repository ppa:duggan/bats --yes
|
|
- sudo apt-get update -qq
|
|
- sudo apt-get install -qq bats
|
|
- sudo apt-get install -qq curl
|
|
# to run petstore server locally via docker
|
|
- docker pull swaggerapi/petstore
|
|
- docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
|
|
- docker ps -a
|
|
# show host table to confirm petstore.swagger.io is mapped to localhost
|
|
- cat /etc/hosts
|
|
override:
|
|
- cp pom.xml.circleci pom.xml
|
|
|
|
test:
|
|
override:
|
|
## test with jdk8
|
|
- java -version
|
|
- mvn -q clean verify -Psamples
|
|
# skip the rest if previous mvn task fails
|
|
- if [ $? -ne 0 ]; then exit 1; fi
|
|
## test with jdk7
|
|
- sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
|
|
- java -version
|
|
- mvn -q clean verify -Psamples
|
|
# skip the rest if previous mvn task fails
|
|
- if [ $? -ne 0 ]; then exit 1; fi
|
|
## docker: build generator image and push to Docker Hub
|
|
- if [ $DOCKER_HUB_USERNAME ]; then docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build --rm=false -t $DOCKER_GENERATOR_IMAGE_NAME ./modules/swagger-generator && if [ ! -z "$CIRCLE_TAG" ]; then docker tag $DOCKER_GENERATOR_IMAGE_NAME:latest $DOCKER_GENERATOR_IMAGE_NAME:$CIRCLE_TAG; fi && if [ ! -z "$CIRCLE_TAG" ] || [ "$CIRCLE_BRANCH" = "master" ]; then docker push $DOCKER_GENERATOR_IMAGE_NAME; fi; fi
|
|
## docker: build cli image and push to Docker Hub
|
|
- if [ $DOCKER_HUB_USERNAME ]; then docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build --rm=false -t $DOCKER_CODEGEN_CLI_IMAGE_NAME ./modules/swagger-codegen-cli && if [ ! -z "$CIRCLE_TAG" ]; then docker tag $DOCKER_CODEGEN_CLI_IMAGE_NAME:latest $DOCKER_CODEGEN_CLI_IMAGE_NAME:$CIRCLE_TAG; fi && if [ ! -z "$CIRCLE_TAG" ] || [ "$CIRCLE_BRANCH" = "master" ]; then docker push $DOCKER_CODEGEN_CLI_IMAGE_NAME; fi; fi
|