Skip to content

Commit c2c0c82

Browse files
authored
feat: Implement openapi client code generator | NPG-6475 (#580)
# Description Implement openapi client generator to automatically generate cat-data-service client code ## Type of change - [X] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [X] This change requires a documentation update ## How Has This Been Tested? - [X] Navigate to the test folder and run `earthly +generate-client` ## Checklist - [X] My code follows the style guidelines of this project - [X] I have performed a self-review of my code - [X] I have commented my code, particularly in hard-to-understand areas - [X] I have made corresponding changes to the documentation - [X] My changes generate no new warnings - [X] I have added tests that prove my fix is effective or that my feature works - [X] New and existing unit tests pass locally with my changes - [X] Any dependent changes have been merged and published in downstream modules
1 parent da44c0c commit c2c0c82

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ result*
107107
.vscode
108108
**/.idea/
109109
.temp/
110+
tests/tmp/
110111

111112
# std
112113
.std

tests/Earthfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
VERSION 0.7
2+
3+
FROM debian:stable-slim
4+
5+
# BASH, CURL, GPG, NODEJS, NPM, JRE
6+
dependencies:
7+
RUN apt-get update
8+
RUN apt-get install bash
9+
RUN apt-get install curl -y
10+
RUN apt-get install gpg -y
11+
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
12+
RUN apt-get install nodejs -y
13+
RUN apt-get install npm -y
14+
RUN apt-get install default-jre -y
15+
16+
generate-client:
17+
FROM +dependencies
18+
19+
# TODO(@nicopado): Get the correct file from openapi doc generation target - https://github.com/input-output-hk/catalyst-core/issues/589
20+
ARG openapispec_file="./petstore.yaml"
21+
COPY $openapispec_file .
22+
23+
RUN npm install @openapitools/openapi-generator-cli -g
24+
25+
RUN openapi-generator-cli validate -i $openapispec_file
26+
27+
RUN openapi-generator-cli generate -i $openapispec_file -g rust -o ./tmp/client/ --package-name cat-data-service-client

0 commit comments

Comments
 (0)