You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+54-2Lines changed: 54 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,9 +128,61 @@ OPTIONS:
128
128
-h, --help Show help information.
129
129
```
130
130
131
-
## Example projects
131
+
## ApodiniMigratorExample
132
132
133
-
See [Examples](https://github.com/Apodini/ApodiniMigrator)
133
+
[ApodiniMigratorExample](https://github.com/Apodini/ApodiniMigratorExample) includes two different versions of an Apodini Web Service using `ApodiniMigrator` configuration. The corresponding documents of those versions can be found in the [ExampleDocuments](https://github.com/Apodini/ApodiniMigrator/tree/develop/Resources/ExampleDocuments) of this repository. In order to test out the functionalities of `migrator` CLI, a preconfigured Ruby script in the root of this repository can be used (see [migrator](https://github.com/Apodini/ApodiniMigrator/blob/develop/migrator))
134
+
135
+
In order to generate the intermediary client library for the initial version run the script with `generate` argument:
136
+
137
+
```console
138
+
$ ./migrator generate
139
+
info org.apodini.migrator : Starting generation of package QONECTIQ
140
+
info org.apodini.migrator : Preparing project directories...
141
+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/HTTP
142
+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/Utils
143
+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/Resources
144
+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/Endpoints
145
+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/Models
146
+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/Networking
147
+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Tests
148
+
info org.apodini.migrator : Package QONECTIQ was generated successfully. You can open the package via QONECTIQ/Package.swift
149
+
```
150
+
Each endpoint of the library can be accessed via the caseless enumeration `API` as follows:
151
+
152
+
```swift
153
+
API.getEventWithID(id: UUID())
154
+
.sink { completion in
155
+
ifcaselet .failure(error) = completion {
156
+
print("Failed to get the event with error: \(error)")
157
+
}
158
+
} receiveValue: { event in
159
+
print("Received event \(event.title)")
160
+
}
161
+
```
162
+
163
+
Migration guide can be generated via:
164
+
165
+
```console
166
+
$ ./migrator compare
167
+
info org.apodini.migrator : Starting generation of the migration guide...
168
+
info org.apodini.migrator : Migration guide was generated successfully at /path/to/ApodiniMigrator/Resources/ExampleDocuments/migration_guide.json.
169
+
```
170
+
171
+
Once the migration guide has been generate, use `migrate` argument to migrate the initial library:
172
+
173
+
```console
174
+
$ ./migrator migrate
175
+
info org.apodini.migrator : Starting migration of package QONECTIQ
176
+
info org.apodini.migrator : Preparing project directories...
177
+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/HTTP
178
+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/Utils
179
+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/Resources
180
+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/Endpoints
181
+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/Models
182
+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/Networking
183
+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Tests
184
+
info org.apodini.migrator : Package QONECTIQ was migrated successfully. You can open the package via QONECTIQ/Package.swift
185
+
```
134
186
135
187
## Contributing
136
188
Contributions to this projects are welcome. Please make sure to read the [contribution guidelines](https://github.com/Apodini/.github/blob/release/CONTRIBUTING.md) first.
0 commit comments