Skip to content
This repository was archived by the owner on Oct 30, 2023. It is now read-only.

2.0 #124

Open
wants to merge 131 commits into
base: master
Choose a base branch
from
Open

2.0 #124

Changes from 1 commit
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
1ffd982
updated pull script, index, no cache
fehguy Mar 30, 2017
eb4ded7
updated to 3.x versions
fehguy Jun 19, 2017
72a37b4
refactored to use new annotations
fehguy Jun 19, 2017
4dfbb30
disabled filter
fehguy Jun 19, 2017
769c067
renamed
fehguy Jun 19, 2017
a5d272d
updated deps
fehguy Jun 19, 2017
0373073
hack in scanning
fehguy Jun 19, 2017
8639fc1
disable filter
fehguy Jun 19, 2017
35137c9
update annotations
fehguy Jun 19, 2017
7ce11b0
added provider
fehguy Jun 19, 2017
9ed0da9
enabled pet resource
fehguy Jun 19, 2017
e1b7f34
added metadata class for `info`
fehguy Jun 19, 2017
8eea146
enabled yaml
fehguy Jun 28, 2017
8b19f0e
Update PetResource.java
fehguy Jun 30, 2017
95addce
added missing import
webron Jul 3, 2017
79dd2a9
refs swagger-api/swagger-core#2312 - bootstrap draft
frantuma Jul 22, 2017
52794b3
refs swagger-api/swagger-core#2312 - bootstrap enhanced draft
frantuma Jul 24, 2017
40576a3
refs swagger-api/swagger-core#2312 - bootstrap swagger-web integration
frantuma Jul 25, 2017
6db5309
refs swagger-api/swagger-core#2312 - fix api url in bootstrap sample
frantuma Jul 25, 2017
dfdeeec
refs swagger-api/swagger-core#2312 - rename builder methods
frantuma Jul 25, 2017
61096c8
refs swagger-api/swagger-core#2312 - adapt to bootstrap refactor
frantuma Jul 31, 2017
c7fa2cd
refs swagger-api/swagger-core#2312 - fix readme and tags
frantuma Aug 1, 2017
afb634a
rename jaxrs OpenApiResource
frantuma Aug 1, 2017
ebb060b
naming cleanup
frantuma Aug 2, 2017
16a0650
config naming
frantuma Aug 2, 2017
e515333
samples 2.0 cleanup
frantuma Aug 11, 2017
99df121
add resource classes example
frantuma Aug 21, 2017
7998b19
Merge pull request #96 from frantuma/add-resource-classes-example
frantuma Aug 21, 2017
3399f76
adapt swagger-core #2394 changes
frantuma Aug 24, 2017
7190751
Merge pull request #97 from frantuma/adapt-2394-changes
frantuma Aug 24, 2017
9835aec
update deps versions
frantuma Sep 26, 2017
ce45fca
updates sample resources
frantuma Sep 26, 2017
733686c
Merge pull request #100 from swagger-api/samples-3.0
frantuma Sep 26, 2017
e2028cc
updates dropwizard sample resources
frantuma Sep 29, 2017
7e51066
Merge pull request #101 from swagger-api/dropwizard-resources
frantuma Sep 29, 2017
faef9ea
updates swagger path
frantuma Sep 29, 2017
7932c14
Merge pull request #102 from swagger-api/fix-exposed-file
frantuma Sep 29, 2017
c9339db
fix info annotation
frantuma Oct 13, 2017
4c074a4
Merge pull request #103 from swagger-api/fix-info-annotation
frantuma Oct 16, 2017
ed6093e
refs swagger-api/swagger-core#2485 - rename packages and groupId
frantuma Oct 25, 2017
d81edd3
Merge pull request #105 from swagger-api/ticket-2485
frantuma Oct 31, 2017
b7862d2
resteasy and enhanced init options
frantuma Oct 26, 2017
a9d5a5b
Merge pull request #106 from swagger-api/integration-initializer
frantuma Nov 2, 2017
0f90f9f
improved/added samples
frantuma Nov 7, 2017
ed47d4a
Merge pull request #107 from swagger-api/enhanced-jersey-samples
frantuma Nov 7, 2017
5f336a8
refs swagger-api/swagger-core#2515 - add jersey sample with resource …
frantuma Nov 11, 2017
42b682e
Merge pull request #108 from swagger-api/ticket-2515
frantuma Nov 11, 2017
7efd36b
jetty inflector sample
gracekarina Nov 24, 2017
d415b98
adding readme file - changing swagger.yaml for openapi.yaml
gracekarina Nov 26, 2017
2407d1d
inflector dropwizard sample
gracekarina Nov 27, 2017
67ea86c
Merge pull request #109 from swagger-api/inflector-jetty-sample
frantuma Nov 27, 2017
ffaf42a
inflector dropwizard sample - fix pom
frantuma Nov 27, 2017
0430462
Merge pull request #110 from swagger-api/inflector-dropwizard
frantuma Nov 27, 2017
65ad90b
springboot-jersey sample
gracekarina Nov 27, 2017
0bcd09a
dropwizard guice with openapi 3.0
gracekarina Nov 28, 2017
0a49338
fix deps in inflector-dropwizard-guice and springboot-jersey
frantuma Nov 30, 2017
4fcfa18
Merge pull request #111 from swagger-api/inflector-dropwizard
frantuma Dec 1, 2017
5a3b4e9
adding formdata support to sample
gracekarina Dec 29, 2017
35b67e1
refs swagger-api/swagger-core#2607 - adds sub resource resource
frantuma Jan 12, 2018
20b40a6
Merge pull request #113 from swagger-api/feature/subresources
frantuma Jan 12, 2018
74659c4
refs swagger-api/swagger-core#2607 - cleanup
frantuma Jan 12, 2018
24dc8cc
Merge pull request #114 from swagger-api/feature/subresources
frantuma Jan 12, 2018
bee2634
Adding new module
Jan 26, 2018
64adf45
Pet Resource Sample Module, Resources added
Feb 1, 2018
e2c502c
Examples, Links, Security, Tags
Feb 1, 2018
a86b197
Callbacks
Feb 2, 2018
4b5119a
Request Body Initial Resources
Feb 2, 2018
d188b88
Responses
Feb 2, 2018
7bc7c93
guice/jersey sample
frantuma Feb 2, 2018
dbaa7e7
Merge pull request #115 from swagger-api/guice-sample
frantuma Feb 2, 2018
9d96f42
Merge branch '2.0' of https://github.com/swagger-api/swagger-samples …
Feb 4, 2018
35e13d7
Adding new esamples
Feb 4, 2018
3740678
Parameters
Feb 4, 2018
13b4673
RequestBody update
Feb 4, 2018
921a549
Merge pull request #116 from swagger-api/feature_sample_jersey2_petstore
frantuma Feb 16, 2018
d232e43
petstore sample minor fix
frantuma Feb 19, 2018
10155aa
Merge pull request #118 from swagger-api/pet-sample-minor
frantuma Feb 19, 2018
a4c35dd
add minimal samples
frantuma Mar 13, 2018
1fecc28
Merge pull request #119 from swagger-api/wiki
frantuma Mar 13, 2018
de7161e
remove redundant metadata
frantuma Mar 13, 2018
f5a7741
Merge pull request #120 from swagger-api/wiki
frantuma Mar 13, 2018
2af6a71
OpenApiServlet standalone sample
frantuma Mar 15, 2018
c80a6e4
Merge pull request #122 from swagger-api/wiki
frantuma Mar 15, 2018
dd3fb81
OpenApiServlet standalone sample rename
frantuma Mar 15, 2018
d4a7939
Merge pull request #123 from swagger-api/wiki
frantuma Mar 15, 2018
17b27f5
OpenApiServlet standalone sample with external resources lib
frantuma Mar 16, 2018
7f0fed4
Merge pull request #125 from swagger-api/resource-lib
frantuma Mar 16, 2018
82b8b63
fixing jetty version in pom inflector-jetty-webxml
gracekarina Apr 26, 2018
ff13841
Merge pull request #131 from swagger-api/fix-jetty-deps
gracekarina Apr 26, 2018
c0abd99
jdk9 support and updated UI
frantuma Apr 25, 2018
d651e77
Merge pull request #132 from swagger-api/jdk9
frantuma May 2, 2018
1bfcb2d
added swagger-petstore v3 sample
ralphdoe May 23, 2018
be78ab9
Merge pull request #135 from swagger-api/feature/oas3_petstore_sample
frantuma Jan 18, 2019
02caa62
bump to swagger-petstore v3 to 1.0.1-SNAPSHOT
frantuma Jan 18, 2019
45c205f
Merge pull request #166 from swagger-api/bump-petstore3-snapshot
frantuma Jan 18, 2019
5d26194
fix swagger-petstore spec
frantuma Jan 23, 2019
73b6f99
Merge pull request #167 from swagger-api/fix-swagger-petstore-spec
frantuma Jan 23, 2019
02479d0
prepare swagger-petstore release 1.0.1
frantuma Jan 23, 2019
6d6c0a8
Merge pull request #168 from swagger-api/prepare-petstore-release-1.0.1
frantuma Jan 23, 2019
a457621
bump swagger-petstore v3 to 1.0.2-SNAPSHOT
frantuma Jan 23, 2019
c8ccd85
Merge pull request #169 from swagger-api/bump-petstore3-snapshot
frantuma Jan 23, 2019
8abf849
Initial Updates - General Change
ralphdoe Feb 27, 2019
869e7d9
java-jersey2-webxml solution
ralphdoe Mar 20, 2019
06af7df
Appclasses, configfile, guice fixed
ralphdoe Mar 21, 2019
8b2aba5
Inflector Dropwizard 2.0.8-SNAPSHOT en swagger-core
ralphdoe Mar 22, 2019
278dacd
java-jersey2-alternatives and java-dropwizard
ralphdoe Mar 25, 2019
8ef9fd5
Java-jersey2-alternatives, java-jersey2-resourceinit, java-jersey2-we…
ralphdoe Mar 26, 2019
dcf98da
java-jersey2-petstore fixed
ralphdoe Mar 27, 2019
e1807b3
java-jersey2-resourceinit, java/java-jaxrs2-openapiservlet fixed
ralphdoe Mar 27, 2019
21c0dc6
Pull Request Fixes
ralphdoe Apr 9, 2019
8a2015d
fix typo
frantuma Apr 11, 2019
fcb1f93
Merge pull request #172 from swagger-api/feature/update-2.0
frantuma Apr 11, 2019
9e5e525
Readme Update 2.0 - Security Section and License Added
ralphdoe Jun 5, 2019
d1a1c5a
Readme Update 2.0 - License fixed
ralphdoe Jun 6, 2019
65813da
Merge pull request #178 from swagger-api/feature/readme_update_securi…
frantuma Jun 20, 2019
b5d4c2f
ref swagger-api/swagger-core#2680 - configure date in jersey jackson …
frantuma Aug 1, 2019
9a7d7cf
Merge pull request #180 from swagger-api/core-ticket-2680
frantuma Aug 1, 2019
c62a19e
fix exposed spec - remove inflector extensions
frantuma Aug 28, 2019
bb11abe
Merge pull request #181 from swagger-api/petstore3-fix-spec
frantuma Aug 28, 2019
27ab2f5
prepare swagger-petstore release 1.0.2
frantuma Aug 28, 2019
92d0252
Merge pull request #182 from swagger-api/prepare-petstore-release-1.0.2
frantuma Aug 28, 2019
2cca833
moved petstore to https://github.com/swagger-api/swagger-petstore/tre…
frantuma Sep 11, 2019
da7eff3
Merge pull request #184 from swagger-api/move-petstore-v3
frantuma Sep 11, 2019
99820b2
update jackson to 2.9.10
frantuma Sep 28, 2019
b1f59c3
Merge pull request #185 from swagger-api/update-jackson
frantuma Sep 28, 2019
710c956
add swagger-gradle-plugin-sample
frantuma Feb 13, 2020
faf1f47
jackson 2.10.3
frantuma Mar 6, 2020
ebb654c
Merge pull request #196 from swagger-api/jackson-2.10.3
frantuma Mar 6, 2020
1aee743
fix typo in README.md (#202)
saxicek Aug 11, 2020
971a2fe
partial update of swagger-core to 2.0.9 and 2.2.0
frantuma Apr 25, 2022
453fa37
Merge pull request #213 from swagger-api/core-update
frantuma Apr 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add swagger-gradle-plugin-sample
frantuma committed Feb 13, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 710c956216d77fb23305e13f03d7a0a9f63d26a5
32 changes: 32 additions & 0 deletions java/swagger-gradle-plugin-sample/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Created by .ignore support plugin (hsz.mobi)
### Gradle template
.gradle
/build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Cache of project
.gradletasknamecache

.idea

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

test/
35 changes: 35 additions & 0 deletions java/swagger-gradle-plugin-sample/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
plugins {
id 'java'
id "io.swagger.core.v3.swagger-gradle-plugin" version '2.0.10'
}

group 'io.swagger.test'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8

repositories {
jcenter()
mavenLocal()
mavenCentral()

}

dependencies {
compile group: 'org.apache.commons', name: 'commons-lang3', version:'3.7'
compile group: 'javax.ws.rs', name: 'javax.ws.rs-api', version:'2.1'
compile group: 'javax.servlet', name: 'javax.servlet-api', version:'3.1.0'
testCompile group: 'junit', name: 'junit', version: '4.12'
}

resolve {

outputFileName = 'PetStoreAPI'
//outputFormat = 'JSONANDYAML'
outputFormat = 'YAML'
prettyPrint = 'TRUE'
classpath = sourceSets.main.runtimeClasspath
resourcePackages = ['io.swagger.v3.plugins.grudle.petstore']
outputDir = file(project.buildDir)

}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
172 changes: 172 additions & 0 deletions java/swagger-gradle-plugin-sample/gradlew
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
#!/usr/bin/env sh

##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn () {
echo "$*"
}

die () {
echo
echo "$*"
echo
exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option

if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
84 changes: 84 additions & 0 deletions java/swagger-gradle-plugin-sample/gradlew.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
10 changes: 10 additions & 0 deletions java/swagger-gradle-plugin-sample/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pluginManagement {
repositories {
maven {
url mavenLocal().url
}
gradlePluginPortal()
}
}
rootProject.name = 'swagger-gradle-plugin-sample'

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* Copyright 2016 SmartBear Software
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.swagger.v3.plugins.grudle.petstore;

import io.swagger.v3.plugins.grudle.resources.model.Pet;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;

@Consumes("application/json")
@Path("/pet")
@Produces({"application/json", "application/xml"})
public class PetResource {
@GET
@Path("/{petId}")
public Pet getPetById(
@PathParam("petId") final Long petId) {
Pet p = new Pet();
p.setId(1);
p.setName("nam");
return p;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* Copyright 2016 SmartBear Software
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.swagger.v3.plugins.grudle.resources.model;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "Category")
public class Category {
private long id;
private String name;

@XmlElement(name = "id")
public long getId() {
return id;
}

public void setId(long id) {
this.id = id;
}

@XmlElement(name = "name")
public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public Category() {
}

public Category(String name) {
this.name = name;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package io.swagger.v3.plugins.grudle.resources.model;


import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.ArrayList;
import java.util.List;

@XmlRootElement(name = "Pet")
public class Pet {
private long id;
private Category category;
private String name;
private List<String> photoUrls = new ArrayList<String>();
private String status;

@XmlElement(name = "id")
public long getId() {
return id;
}

public void setId(long id) {
this.id = id;
}

@XmlElement(name = "category")
public Category getCategory() {
return category;
}

public void setCategory(Category category) {
this.category = category;
}

@XmlElement(name = "name")
public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

@XmlElementWrapper(name = "photoUrls")
@XmlElement(name = "photoUrl")
public List<String> getPhotoUrls() {
return photoUrls;
}

public void setPhotoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
}

@XmlElement(name = "status")
public String getStatus() {
return status;
}

public void setStatus(String status) {
this.status = status;
}
}