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: swagger/README.md
+29-20Lines changed: 29 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,30 +4,13 @@ This README documents the commands used to create the swagger docs for the API c
4
4
5
5
If you need to manually generate the swagger after making a change then the following commands in this order will create the correct results:
6
6
7
-
## Command order
8
-
9
-
```shell
10
-
nrlf swagger merge producer
11
-
nrlf swagger merge consumer
12
-
nrlf swagger generate-model producer
13
-
nrlf swagger generate-model consumer
14
-
```
15
-
16
-
## Generate - DO NOT DO THIS UNLESS EXPLICITLY TOLD TO
17
-
18
-
PLEASE DO NOT USE THIS COMMAND UNLESS EXPLICITLY TOLD TO DO SO. This command was useful when NRLF was in it's infancy, but since then the generated swagger files have been manually modified, so running this command will lose ALL of that that information! instead please use generate-model steps as mentioned above.
19
-
20
-
The generate command recreates the two swagger files for the consumer and producer using the fhir swagger generator - it will then use that `./api/*/swagger.yaml` file to generate the pydantic models using the datamodel-codegen package
21
-
22
-
you can run the swagger generate using the below command:
23
-
24
7
```shell
25
-
nrlf swagger generate
8
+
make swagger-merge TYPE={type}
26
9
```
27
10
28
-
## Merge
11
+
With TYPE being one of the following: `consumer` or `producer`.
29
12
30
-
The merge command will take the changes in the static swagger files and merge them into the freshly generated swagger.yaml files, it will do the following:
13
+
This command uses the merge command from the swagger.sh script which will take the changes in the static swagger files and merge them into the freshly generated swagger.yaml files, it will do the following:
31
14
32
15
- remove commented lines
33
16
- replace the snake case terms
@@ -40,3 +23,29 @@ It will then:
40
23
And finally:
41
24
42
25
- remove all information that is not required for public documentation (e.g. security sections and authorisers) and put that into the `nrl-*-api.yaml` files
26
+
27
+
## Generate Model - DO NOT DO THIS UNLESS NEW PYDANTIC MODELS ARE REQUIRED
28
+
29
+
PLEASE DO NOT USE THIS COMMAND UNLESS EXPLICITLY TOLD TO DO SO. This command is only useful when we need to generate the new Pydantic Models, but FHIR does not update often enough to warrant regenerating the models constantly.
30
+
31
+
The generate- command will use that `./api/*/swagger.yaml` file that was generated in the swagger-merge step, to generate the pydantic models using the datamodel-codegen package
32
+
33
+
you can run the model generate using the below command:
34
+
35
+
```shell
36
+
make generate-model TYPE={type}
37
+
```
38
+
39
+
With TYPE being one of the following: `consumer` or `producer`.
40
+
41
+
## Generate - DO NOT DO THIS UNLESS EXPLICITLY TOLD TO
42
+
43
+
PLEASE DO NOT USE THIS COMMAND UNLESS EXPLICITLY TOLD TO DO SO. This command was useful when NRLF was in it's infancy, but since then the generated swagger files have been manually modified, so running this command will lose ALL of that that information! instead please use generate-model steps as mentioned above.
44
+
45
+
The generate command recreates the two swagger files for the consumer and producer using the fhir swagger generator - it will then use that `./api/*/swagger.yaml` file to generate the pydantic models using the datamodel-codegen package
46
+
47
+
you can run the swagger generate using the below command:
0 commit comments