|
2 | 2 |
|
3 | 3 | Service for validating ESDL files against validation schemas |
4 | 4 |
|
| 5 | +## Usage |
| 6 | + |
| 7 | +To start the service locally run |
| 8 | + |
| 9 | +```bash |
| 10 | +docker-compose up |
| 11 | +``` |
| 12 | + |
| 13 | +Then go to `localhost:3011` to see the available endpoints. |
| 14 | +First upload the validation schema `testdata/schemas/schema_Poc.json` using `POST /schema`. |
| 15 | +`GET /schema` returns a list of the available schema id's, names and descriptions. |
| 16 | +`GET /schema/{schema_id_or_name}` returns a schema by id. |
| 17 | + |
| 18 | +To run the validation use `POST /validationToMessages/` with the esdl as string (for instance |
| 19 | +`testdata/esdls/Single_pipes.esdl`) and the schema id. |
| 20 | +This should return a response with errors and warnings: |
| 21 | + |
| 22 | +```json |
| 23 | +[ |
| 24 | + { |
| 25 | + "assetID": "6f45c6f8-e8e2-4378-a910-45140337b9dd", |
| 26 | + "messages": [ |
| 27 | + { |
| 28 | + "message": "Only one of supplyTemperature or returnTemperature must be defined for asset 6f45c6f8-e8e2-4378-a910-45140337b9dd (HotSide)", |
| 29 | + "severity": "ERROR" |
| 30 | + }, |
| 31 | + { |
| 32 | + "message": "6f45c6f8-e8e2-4378-a910-45140337b9dd (HotSide) does not have a parallel return asset with the name (HotSide_ret)", |
| 33 | + "severity": "ERROR" |
| 34 | + } |
| 35 | + ] |
| 36 | + }, |
| 37 | + { |
| 38 | + "assetID": "e11a2daa-2e56-4635-afb3-1e23c6d08c33", |
| 39 | + "messages": [ |
| 40 | + { |
| 41 | + "message": "e11a2daa-2e56-4635-afb3-1e23c6d08c33's OutPort is unconnected", |
| 42 | + "severity": "WARNING" |
| 43 | + } |
| 44 | + ] |
| 45 | + }, |
| 46 | + { |
| 47 | + "assetID": "c407387a-ebfd-41b7-af1b-9cae7aec842b", |
| 48 | + "messages": [ |
| 49 | + { |
| 50 | + "message": "c407387a-ebfd-41b7-af1b-9cae7aec842b's InPort is unconnected", |
| 51 | + "severity": "WARNING" |
| 52 | + } |
| 53 | + ] |
| 54 | + }, |
| 55 | + { |
| 56 | + "assetID": "e677bac5-48e0-4ac0-b2a9-5a329b00b0d6", |
| 57 | + "messages": [ |
| 58 | + { |
| 59 | + "message": "e677bac5-48e0-4ac0-b2a9-5a329b00b0d6's OutPort is unconnected", |
| 60 | + "severity": "WARNING" |
| 61 | + } |
| 62 | + ] |
| 63 | + }, |
| 64 | + { |
| 65 | + "assetID": "737494af-8ac4-4ebe-a11a-e89f6f2c415a", |
| 66 | + "messages": [ |
| 67 | + { |
| 68 | + "message": "737494af-8ac4-4ebe-a11a-e89f6f2c415a's InPort is unconnected", |
| 69 | + "severity": "WARNING" |
| 70 | + }, |
| 71 | + { |
| 72 | + "message": "737494af-8ac4-4ebe-a11a-e89f6f2c415a (Pipe_7374) does not have a parallel return asset with the name (Pipe_7374_ret)", |
| 73 | + "severity": "ERROR" |
| 74 | + } |
| 75 | + ] |
| 76 | + }, |
| 77 | + { |
| 78 | + "assetID": "363103d6-a32e-40a6-b3a9-ae376c944f6b", |
| 79 | + "messages": [ |
| 80 | + { |
| 81 | + "message": "363103d6-a32e-40a6-b3a9-ae376c944f6b (Pipe_3631) does not have a parallel return asset with the name (Pipe_3631_ret)", |
| 82 | + "severity": "ERROR" |
| 83 | + } |
| 84 | + ] |
| 85 | + }, |
| 86 | + { |
| 87 | + "assetID": "83582c37-b692-4432-8430-4e3407ed4c08", |
| 88 | + "messages": [ |
| 89 | + { |
| 90 | + "message": "83582c37-b692-4432-8430-4e3407ed4c08 (Pipe_8358) does not have a parallel return asset with the name (Pipe_8358_ret)", |
| 91 | + "severity": "ERROR" |
| 92 | + } |
| 93 | + ] |
| 94 | + }, |
| 95 | + { |
| 96 | + "assetID": "a5142229-9331-4313-a52b-70c3da15f4a9", |
| 97 | + "messages": [ |
| 98 | + { |
| 99 | + "message": "a5142229-9331-4313-a52b-70c3da15f4a9 (Pipe_a514) does not have a parallel return asset with the name (Pipe_a514_ret)", |
| 100 | + "severity": "ERROR" |
| 101 | + } |
| 102 | + ] |
| 103 | + }, |
| 104 | + { |
| 105 | + "assetID": "0fc640c8-7f6b-45ae-8e40-2966c1377761", |
| 106 | + "messages": [ |
| 107 | + { |
| 108 | + "message": "0fc640c8-7f6b-45ae-8e40-2966c1377761 (Pipe_0fc6) does not have a parallel return asset with the name (Pipe_0fc6_ret)", |
| 109 | + "severity": "ERROR" |
| 110 | + } |
| 111 | + ] |
| 112 | + }, |
| 113 | + { |
| 114 | + "assetID": "a0b0a95a-76c6-4afa-a319-f41297c5be6e", |
| 115 | + "messages": [ |
| 116 | + { |
| 117 | + "message": "a0b0a95a-76c6-4afa-a319-f41297c5be6e (Pipe_a0b0) does not have a parallel return asset with the name (Pipe_a0b0_ret)", |
| 118 | + "severity": "ERROR" |
| 119 | + } |
| 120 | + ] |
| 121 | + }, |
| 122 | + { |
| 123 | + "assetID": "f6779198-7d2a-456b-997b-58b9a02cdb2d", |
| 124 | + "messages": [ |
| 125 | + { |
| 126 | + "message": "f6779198-7d2a-456b-997b-58b9a02cdb2d (Joint_f677) does not have a parallel return asset with the name (Joint_f677_ret)", |
| 127 | + "severity": "ERROR" |
| 128 | + } |
| 129 | + ] |
| 130 | + }, |
| 131 | + { |
| 132 | + "assetID": "7aae2f5f-c3d4-4041-9577-d0a46124df09", |
| 133 | + "messages": [ |
| 134 | + { |
| 135 | + "message": "7aae2f5f-c3d4-4041-9577-d0a46124df09 (Joint_7aae) does not have a parallel return asset with the name (Joint_7aae_ret)", |
| 136 | + "severity": "ERROR" |
| 137 | + } |
| 138 | + ] |
| 139 | + }, |
| 140 | + { |
| 141 | + "assetID": "f5214b94-d097-4fa9-a86a-110a1386f884", |
| 142 | + "messages": [ |
| 143 | + { |
| 144 | + "message": "f5214b94-d097-4fa9-a86a-110a1386f884 (Joint_f521) does not have a parallel return asset with the name (Joint_f521_ret)", |
| 145 | + "severity": "ERROR" |
| 146 | + } |
| 147 | + ] |
| 148 | + } |
| 149 | +] |
| 150 | +``` |
| 151 | + |
5 | 152 | ## Status |
6 | 153 |
|
7 | 154 | **work in progress** |
|
0 commit comments