16#ifndef QGSSERVEROGCAPIHANDLER_H
17#define QGSSERVEROGCAPIHANDLER_H
19#include <nlohmann/json_fwd.hpp>
21#include "qgis_server.h"
25#include <QRegularExpression>
28using namespace nlohmann;
112 virtual QRegularExpression
path()
const = 0;
145 virtual QStringList
tags()
const {
return {}; }
161 QList<QgsServerOgcApi::ContentType> contentTypes() const
SIP_SKIP;
198 QString contentTypeForAccept( const QString &accept ) const;
229 void write( json &data,
const QgsServerApiContext &context,
const json &htmlMetadata =
nullptr )
const;
237 void jsonDump( json &data,
const QgsServerApiContext &context,
const QString &contentType = QStringLiteral(
"application/json" ) )
const;
323 std::
string href( const
QgsServerApiContext &context, const QString &extraPath = QString(), const QString &extension = QString() ) const;
356 static QString parentLink( const QUrl &url,
int levels = 1 );
369 static json defaultResponse()
SIP_SKIP;
384 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,...)