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"
27using namespace nlohmann;
111 virtual QRegularExpression
path()
const = 0;
144 virtual QStringList
tags()
const {
return {}; }
160 QList<QgsServerOgcApi::ContentType> contentTypes() const
SIP_SKIP;
197 QString contentTypeForAccept( const QString &accept ) const;
228 void write( json &data,
const QgsServerApiContext &context,
const json &htmlMetadata =
nullptr )
const;
236 void jsonDump( json &data,
const QgsServerApiContext &context,
const QString &contentType = QStringLiteral(
"application/json" ) )
const;
322 std::
string href( const
QgsServerApiContext &context, const QString &extraPath = QString(), const QString &extension = QString() ) const;
355 static QString parentLink( const QUrl &url,
int levels = 1 );
368 static json defaultResponse()
SIP_SKIP;
383 void setContentTypesInt( const QList<
int> &contentTypes )
SIP_PYNAME( setContentTypes );
Bad request error API exception.
The QgsServerApiContext class encapsulates the resources for a particular client request: the request...
The QgsServerOgcApiHandler abstract class represents a OGC API handler to be registered in QgsServerO...
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.
QgsServerRequest Class defining request interface passed to services QgsService::executeRequest() met...
Represents a vector layer which manages a vector based data sets.
#define SIP_VIRTUALERRORHANDLER(name)
#define SIP_THROW(name,...)