-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.surfgen.generator.yaml
90 lines (74 loc) · 2.99 KB
/
.surfgen.generator.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# if set to true then nullability will be determined by the `nullable` property of OpenAPI schema
# if set to false then `required` will be used
# for more info look at https://github.com/surfstudio/SurfGen#nullability
useNewNullableDeterminationStrategy: true
# Will remove listed prefixes from method names
# for detais look at https://github.com/surfstudio/SurfGen#prefix-cutting
prefixesToCutDownInServiceNames:
- "/api/v1"
# Will remove OpenAPI node by path /components/schemas/BadModel
# in file Tests/Common/NodeExcluding/models.yaml
#
# At run time. It doesn't touch real files
#
# In generated code all referenсes to removed nodes will be generated as `TODO` string
#
# You can remove by this leaf nodes like:
# - /components/schemas/*
# - /components/parameters/*
# - /components/header/*
# - /components/responses/*
# - /components/requestBodies/*
# - /paths/**/*
#
# To exclude specific operation you can write something like
# /paths/api/v1.1/auth~post
# Where:
# - `paths` - constant from OpenAPI specification
# - `/api/v1.1/auth` - method URI (just like in specification)
# - `post` - operation (you can skip it to remove whole method). Symbol ~ is used to mark specific operation.
exludedNodes:
- "Tests/Common/NodeExcluding/models.yaml#/components/schemas/BadModel"
- "Tests/Common/NodeExcluding/api.yaml#/paths/api/v1.1/superAuth~delete"
templates:
# This option will generate Interface (Protocol) for service
- type: service
nameSuffix: Service
fileExtension: swift
templatePath: ./Templates/v2/Swift/Service.stencil
destinationPath: ./tmp/Sources/Services/{name}
# This template will generate Implementation for service
- type: service
nameSuffix: NetworkService
fileExtension: swift
templatePath: ./Templates/v2/Swift/NetworkService.stencil
destinationPath: ./tmp/Sources/Services/{name}
# This template will generate Business Model
- type: model
nameSuffix: Entity
fileExtension: swift
templatePath: ./Templates/v2/Swift/Entity.stencil
destinationPath: ./tmp/Sources/Models/{name}
# This template will generate Plain Model (for network communication)
- type: model
nameSuffix: Entry
fileExtension: swift
templatePath: ./Templates/v2/Swift/Entry.stencil
destinationPath: ./tmp/Sources/Models/{name}
# This template will generate alias on other types
- type: typealias
fileExtension: swift
templatePath: ./Templates/v2/Swift/Typealias.stencil
destinationPath: ./tmp/Sources/Aliases/{name}
# This template will generate enum
- type: enum
fileExtension: swift
fileNameCase: snakeCase # ATTENTION! Just for example that you can change naming pattern for files
templatePath: ./Templates/v2/Swift/Entity.stencil
destinationPath: ./tmp/Sources/Models/{name}
# We use it to collect analytics about SurfGen usage inside our company.
# You can set it to gather the analytics for your company or just delete it from config
analytcsConfig:
logstashEnpointURI: http://127.0.0.1:6644
payload:
project: Test