16#ifndef QGSSERVEROGCAPIHANDLER_H
17#define QGSSERVEROGCAPIHANDLER_H
19#include <nlohmann/json_fwd.hpp>
21#include "qgis_server.h"
25#include <QRegularExpression>
28using namespace Qt::StringLiterals;
31using namespace nlohmann;
115 virtual QRegularExpression
path()
const = 0;
148 virtual QStringList
tags()
const {
return {}; }
164 QList<QgsServerOgcApi::ContentType> contentTypes() const
SIP_SKIP;
201 QString contentTypeForAccept( const QString &accept ) const;
232 void write( json &data,
const QgsServerApiContext &context,
const json &htmlMetadata =
nullptr )
const;
240 void jsonDump( json &data,
const QgsServerApiContext &context,
const QString &contentType = u
"application/json"_s )
const;
326 std::
string href( const
QgsServerApiContext &context, const QString &extraPath = QString(), const QString &extension = QString() ) const;
359 static QString parentLink( const QUrl &url,
int levels = 1 );
372 static json defaultResponse()
SIP_SKIP;
387 void setContentTypesInt( const QList<
int> &contentTypes )
SIP_PYNAME( setContentTypes );
Bad request error API exception.
Encapsulates the resources for a particular client request.
An abstract class which represents an OGC API handler to be registered in QgsServerOgcApi class.
virtual std::string summary() const =0
Summary.
virtual QgsServerOgcApi::Rel linkType() const =0
Main role for the resource link.
virtual QStringList tags() const
Tags.
virtual std::string linkTitle() const =0
Title for the handler link.
virtual QList< QgsServerQueryStringParameter > parameters(const QgsServerApiContext &context) const
Returns a list of query string parameters.
virtual std::string operationId() const =0
Returns the operation id for template file names and other internal references.
virtual std::string description() const =0
Description.
virtual QRegularExpression path() const =0
URL pattern for this handler, named capture group are automatically extracted and returned by values(...
QGIS Server OGC API endpoint.
ContentType
Media types used for content negotiation, insert more specific first.
@ self
Conveys an identifier for the link’s context.
Defines requests passed to QgsService classes.
Represents a vector layer which manages a vector based dataset.
#define SIP_VIRTUALERRORHANDLER(name)
#define SIP_THROW(name,...)