Added pattern check on schema validators + doc
MODIFY
src/assets/server/rest/v1/docs/e-mobility-oas.json
src/assets/server/rest/v1/docs/e-mobility-oas.json
"description": "Pipe separated Inactivity Statuses (I, W, E)",
"required": false,
"schema": {
- "type": "string"
+ "type": "string",
+ "pattern": "^([IWE](\\|[IWE])*)?$"
}
},
"chargingProfileID": {
"ConnectorStatuses": {
"in": "query",
"name": "ConnectorStatus",
- "description": "Pipe separated connector statuses",
+ "description": "Pipe separated connector statuses (Available, Preparing, Charging, Occupied, SuspendedEVSE, SuspendedEV, Finishing, Reserved, Unavailable, Faulted",
"schema": {
- "type": "string"
+ "type": "string",
+ "pattern": "^((Available|Preparing|Charging|Occupied|SuspendedEVSE|SuspendedEV|Finishing|Reserved|Unavailable|Faulted)(\\||Available|Preparing|Charging|Occupied|SuspendedEVSE|SuspendedEV|Finishing|Reserved|Unavailable|Faulted)*)?$"
}
},
"ConnectorTypes": {
"in": "query",
"name": "ConnectorType",
- "description": "Pipe separated connector types",
+ "description": "Pipe separated connector types (T2, CCS, C, T1, T3C, T1CCS, D, U)",
"schema": {
- "type": "string"
+ "type": "string",
+ "pattern": "^((T2|CCS|C|T1|T3C|T1CCS|D|U)(\\||T2|CCS|C|T1|T3C|T1CCS|D|U)*)?$"
}
},
"LocLongitude": {
"name": "RefundStatus",
"description": "Pipe separated refund statuses (submitted, notSubmitted, cancelled, approved)",
"schema": {
- "type": "string"
+ "type": "string",
+ "pattern": "^((submitted|notSubmitted|cancelled|approved)(\\||submitted|notSubmitted|cancelled|approved)*)?$"
}
},
"tagID": {

MODIFY
src/assets/server/rest/v1/schemas/chargingstation/chargingstations-get.json
src/assets/server/rest/v1/schemas/chargingstation/chargingstations-get.json
},
"ConnectorStatus": {
"type": "string",
+ "pattern": "^((Available|Preparing|Charging|Occupied|SuspendedEVSE|SuspendedEV|Finishing|Reserved|Unavailable|Faulted)(\\||Available|Preparing|Charging|Occupied|SuspendedEVSE|SuspendedEV|Finishing|Reserved|Unavailable|Faulted)*)?$",
"sanitize": "mongo"
},
"ConnectorType": {
- "$ref": "chargingstation.json#/definitions/connector/properties/type"
+ "type": "string",
+ "pattern": "^((T2|CCS|C|T1|T3C|T1CCS|D|U)(\\||T2|CCS|C|T1|T3C|T1CCS|D|U)*)?$",
+ "sanitize": "mongo"
},
"ChargingStationID": {
"$ref": "chargingstation.json#/definitions/id"

MODIFY
src/assets/server/rest/v1/schemas/transaction/transactions-get.json
src/assets/server/rest/v1/schemas/transaction/transactions-get.json
},
"RefundStatus": {
"type": "string",
+ "pattern": "^((submitted|notSubmitted|cancelled|approved)(\\||submitted|notSubmitted|cancelled|approved)*)?$",
"sanitize": "mongo"
},
"InactivityStatus": {
"type": "string",
+ "pattern": "^([IWE](\\|[IWE])*)?$",
"sanitize": "mongo"
},
"MinimalPrice": {

MODIFY
src/storage/mongodb/ChargingStationStorage.ts
src/storage/mongodb/ChargingStationStorage.ts
@@ -256,7 +256,7 @@ export default class ChargingStationStorage {
// Connector Status
if (params.connectorStatuses) {
filters['connectors.status'] = { $in: params.connectorStatuses };
- filters.inactive = false;
+ filters.inactive = true;
// Filter connectors array
aggregation.push({
'$addFields': {

Added pattern check on schema validators + doc