Skip to content

Commit 494443b

Browse files
soffestgermanosinSofia Shnaidman
authored
OpenAPI integration for kafka-ui frontend (#120)
* Added react openapi gen * Integrated Openapi to React Co-authored-by: German Osin <[email protected]> Co-authored-by: Sofia Shnaidman <[email protected]>
1 parent 9fd3697 commit 494443b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+4167
-4493
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ build/
3232
/kafka-ui-api/app/node
3333

3434
.DS_Store
35+
*.code-workspace

kafka-ui-contract/pom.xml

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
54
<parent>
65
<artifactId>kafka-ui</artifactId>
76
<groupId>com.provectus</groupId>
@@ -70,8 +69,57 @@
7069
</configOptions>
7170
</configuration>
7271
</execution>
72+
<execution>
73+
<id>generate-frontend-api</id>
74+
<goals>
75+
<goal>generate</goal>
76+
</goals>
77+
<configuration>
78+
<inputSpec>${project.basedir}/src/main/resources/swagger/kafka-ui-api.yaml
79+
</inputSpec>
80+
<output>${project.build.directory}/generated-sources/frontend/</output>
81+
<generatorName>typescript-fetch</generatorName>
82+
<configOptions>
83+
<modelPackage>com.provectus.kafka.ui.model</modelPackage>
84+
<apiPackage>com.provectus.kafka.ui.api</apiPackage>
85+
<apiPackage>com.provectus.kafka.ui.invoker</apiPackage>
86+
<sourceFolder>kafka-ui-contract</sourceFolder>
87+
<typescriptThreePlus>true</typescriptThreePlus>
88+
<supportsES6>true</supportsES6>
89+
<nullSafeAdditionalProps>true</nullSafeAdditionalProps>
90+
<withInterfaces>true</withInterfaces>
91+
</configOptions>
92+
</configuration>
93+
</execution>
7394
</executions>
7495
</plugin>
96+
<plugin>
97+
<groupId>org.apache.maven.plugins</groupId>
98+
<artifactId>maven-resources-plugin</artifactId>
99+
<version>3.1.0</version>
100+
<executions>
101+
<execution>
102+
<id>copy-resource-one</id>
103+
<phase>generate-resources</phase>
104+
<goals>
105+
<goal>copy-resources</goal>
106+
</goals>
107+
108+
<configuration>
109+
<outputDirectory>${basedir}/..//kafka-ui-react-app/src/generated-sources</outputDirectory>
110+
<resources>
111+
<resource>
112+
<directory>${project.build.directory}/generated-sources/frontend/</directory>
113+
<includes>
114+
<include>**/*.ts</include>
115+
</includes>
116+
</resource>
117+
</resources>
118+
</configuration>
119+
</execution>
120+
</executions>
121+
122+
</plugin>
75123
</plugins>
76124
</build>
77125
</profile>

kafka-ui-react-app/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Kafka REST API
2-
REACT_APP_API_URL=/api
2+
REACT_APP_API_URL=

kafka-ui-react-app/.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,7 @@ npm-debug.log*
2323
yarn-debug.log*
2424
yarn-error.log*
2525

26-
.idea
26+
.idea
27+
28+
# generated sources
29+
src/generated-sources

0 commit comments

Comments
 (0)