16 #ifndef QGSSERVEROGCAPIHANDLER_H
17 #define QGSSERVEROGCAPIHANDLER_H
19 #include <QRegularExpression>
20 #include "qgis_server.h"
23 #include "nlohmann/json_fwd.hpp"
24 #include "inja/inja.hpp"
27 using namespace nlohmann;
113 virtual QRegularExpression path()
const = 0;
116 virtual std::string operationId()
const = 0;
130 virtual std::string summary()
const = 0;
133 virtual std::string description()
const = 0;
136 virtual std::string linkTitle()
const = 0;
142 virtual QStringList
tags()
const {
return {}; }
158 QList<QgsServerOgcApi::ContentType> contentTypes() const
SIP_SKIP;
195 QString contentTypeForAccept( const QString &accept ) const;
200 #ifndef SIP_RUN // Skip SIP
225 void write( json &data,
const QgsServerApiContext &context,
const json &htmlMetadata =
nullptr )
const;
233 void jsonDump( json &data,
const QgsServerApiContext &context,
const QString &contentType = QStringLiteral(
"application/json" ) )
const;
264 const std::string &title =
"" )
const;
288 #endif // SIP skipped
320 std::
string href( const
QgsServerApiContext &context, const QString &extraPath = QString(), const QString &extension = QString() ) const;
353 static QString parentLink( const QUrl &url,
int levels = 1 );
366 static json defaultResponse()
SIP_SKIP;
382 void setContentTypesInt( const QList<
int> &contentTypes )
SIP_PYNAME( setContentTypes );
393 QList<
QgsServerOgcApi::ContentType> mContentTypes = { QgsServerOgcApi::ContentType::JSON, QgsServerOgcApi::ContentType::HTML };
398 #endif // QGSSERVEROGCAPIHANDLER_H