Skip to content

Commit 2916f16

Browse files
committed
Generate API models from front
1 parent 372d3fc commit 2916f16

File tree

63 files changed

+3045
-188
lines changed

Some content is hidden

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

63 files changed

+3045
-188
lines changed

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,3 +246,13 @@ generate-apiserver: ## Generate OpenAPISpec library based on ododevapispec.yaml
246246
--additional-properties=outputAsLibrary=true,onlyInterfaces=true,hideGenerationTimestamp=true && \
247247
echo "Formatting generated files:" && go fmt ./pkg/apiserver-gen/... && \
248248
echo "Removing pkg/apiserver-gen/api/openapi.yaml" && rm ./pkg/apiserver-gen/api/openapi.yaml
249+
250+
.PHONY: generate-apifront
251+
generate-apifront: ## Generate OpenAPISpec library based on ododevapispec.yaml inside ui/src/app
252+
podman run --rm \
253+
-v ${PWD}:/local \
254+
docker.io/openapitools/openapi-generator-cli:v6.6.0 \
255+
generate \
256+
-i /local/ododevapispec.yaml \
257+
-g typescript-angular \
258+
-o /local/ui/src/app/api-gen

ododevapispec.yaml

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ paths:
231231
application/json:
232232
schema:
233233
type: object
234+
required:
235+
- content
234236
properties:
235237
content:
236238
type: string
@@ -380,34 +382,7 @@ paths:
380382
content:
381383
application/json:
382384
schema:
383-
type: object
384-
properties:
385-
name:
386-
type: string
387-
version:
388-
type: string
389-
displayName:
390-
type: string
391-
description:
392-
type: string
393-
tags:
394-
type: string
395-
architectures:
396-
type: string
397-
icon:
398-
type: string
399-
globalMemoryLimit:
400-
type: string
401-
projectType:
402-
type: string
403-
language:
404-
type: string
405-
website:
406-
type: string
407-
provider:
408-
type: string
409-
supportUrl:
410-
type: string
385+
$ref: '#/components/schemas/Metadata'
411386
responses:
412387
'200':
413388
description: metadata was successfully updated
@@ -1151,6 +1126,8 @@ paths:
11511126
application/json:
11521127
schema:
11531128
type: object
1129+
required:
1130+
- chart
11541131
properties:
11551132
chart:
11561133
type: string
@@ -1164,6 +1141,8 @@ paths:
11641141
application/json:
11651142
schema:
11661143
type: object
1144+
required:
1145+
- quantity
11671146
properties:
11681147
quantity:
11691148
type: string

pkg/apiserver-gen/go/routers.go

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/src/app/api-gen/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
wwwroot/*.js
2+
node_modules
3+
typings
4+
dist
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
.gitignore
2+
README.md
3+
api.module.ts
4+
api/api.ts
5+
api/default.service.ts
6+
configuration.ts
7+
encoder.ts
8+
git_push.sh
9+
index.ts
10+
model/applyCommand.ts
11+
model/command.ts
12+
model/componentCommandPostRequest.ts
13+
model/componentGet200Response.ts
14+
model/compositeCommand.ts
15+
model/container.ts
16+
model/devfileContent.ts
17+
model/devstateApplyCommandPostRequest.ts
18+
model/devstateChartGet200Response.ts
19+
model/devstateCommandCommandNameMovePostRequest.ts
20+
model/devstateCommandCommandNameSetDefaultPostRequest.ts
21+
model/devstateCompositeCommandPostRequest.ts
22+
model/devstateContainerPostRequest.ts
23+
model/devstateDevfilePutRequest.ts
24+
model/devstateEventsPutRequest.ts
25+
model/devstateExecCommandPostRequest.ts
26+
model/devstateImagePostRequest.ts
27+
model/devstateQuantityValidPostRequest.ts
28+
model/devstateResourcePostRequest.ts
29+
model/events.ts
30+
model/execCommand.ts
31+
model/generalError.ts
32+
model/generalSuccess.ts
33+
model/image.ts
34+
model/imageCommand.ts
35+
model/instanceGet200Response.ts
36+
model/metadata.ts
37+
model/models.ts
38+
model/resource.ts
39+
param.ts
40+
variables.ts
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6.6.0

0 commit comments

Comments
 (0)