Skip to content

Commit

Permalink
demo: Swagger codegen for ewm service
Browse files Browse the repository at this point in the history
  • Loading branch information
terekhovmv committed Mar 13, 2023
1 parent 88666bf commit da018e0
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 1 deletion.
84 changes: 84 additions & 0 deletions ewm-service-contract/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ru.practicum</groupId>
<artifactId>explore-with-me</artifactId>
<version>${revision}</version>
</parent>

<artifactId>ewm-service-contract</artifactId>
<name>Explore-with-me Service Contract</name>

<properties>
<apiPackage>${project.groupId}.ewm.api</apiPackage>
<modelPackage>${apiPackage}.dto</modelPackage>
<swagger-models.version>2.2.8</swagger-models.version>
<swagger-annotations.version>2.2.8</swagger-annotations.version>
<springdoc-openapi-ui.version>1.6.14</springdoc-openapi-ui.version>
</properties>

<dependencies>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-models</artifactId>
<version>${swagger-models.version}</version>
</dependency>

<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${swagger-annotations.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${springdoc-openapi-ui.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>io.swagger.codegen.v3</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>3.0.41</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/../ewm-main-service-spec.json</inputSpec>
<language>spring</language>
<library>spring-boot</library>
<apiPackage>${apiPackage}</apiPackage>
<modelPackage>${modelPackage}</modelPackage>
<configOptions>
<sourceFolder>src/main/java/</sourceFolder>
<dateLibrary>java8</dateLibrary>
<interfaceOnly>true</interfaceOnly>
<useBeanValidation>true</useBeanValidation>
<performBeanValidation>true</performBeanValidation>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@

<groupId>ru.practicum</groupId>
<artifactId>explore-with-me</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<version>${revision}</version>


<modules>
<module>ewm-service-contract</module>
</modules>


<properties>
<java.version>11</java.version>
Expand Down

0 comments on commit da018e0

Please sign in to comment.