Commit 43cf51b6 authored by Volker Krause's avatar Volker Krause
Browse files

Make the UIC location identifier type configurable per backend

parent 24b0ce02
......@@ -151,6 +151,6 @@ OpenJourneyPlannerParser OpenJourneyPlannerBackend::parser() const
{
OpenJourneyPlannerParser p;
p.setLocationIdentifierType(backendId());
p.setUicLocationIdentifierType(QStringLiteral("uic")); // TODO
p.setUicLocationIdentifierType(m_uicLocationIdentifierType);
return p;
}
......@@ -31,6 +31,10 @@ class OpenJourneyPlannerBackend : public AbstractBackend
Q_PROPERTY(bool useTrias MEMBER m_useTrias)
/** Override the default HTTP ContentType header in the request. */
Q_PROPERTY(QByteArray contentType MEMBER m_contentType)
/** Location identifier type for UIC station codes.
* Typically "uic" or "ibnr".
*/
Q_PROPERTY(QString uicLocationIdentifierType MEMBER m_uicLocationIdentifierType)
public:
static inline constexpr const char* type() { return "openJourneyPlanner"; }
......@@ -50,6 +54,7 @@ private:
QString m_requestorRef;
bool m_useTrias = false;
QByteArray m_contentType = "application/xml";
QString m_uicLocationIdentifierType;
};
}
......
......@@ -167,7 +167,8 @@
},
"options": {
"authorization": "57c5dbbbf1fe4d000100001842c323fa9ff44fbba0b9b925f0c052d1",
"endpoint": "https://api.opentransportdata.swiss/ojp2020"
"endpoint": "https://api.opentransportdata.swiss/ojp2020",
"uicLocationIdentifierType": "uic"
},
"supportedLanguages": [
"de",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment