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;
113 virtual QRegularExpression
path()
const = 0;
142 virtual QStringList
tags()
const {
return {}; }
158 QList<QgsServerOgcApi::ContentType> contentTypes() const
SIP_SKIP;
195 QString contentTypeForAccept( const QString &accept ) const;
226 void write( json &data,
const QgsServerApiContext &context,
const json &htmlMetadata =
nullptr )
const;
234 void jsonDump( json &data,
const QgsServerApiContext &context,
const QString &contentType = QStringLiteral(
"application/json" ) )
const;
265 const std::string &title =
"" )
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;
385 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.
@ JSON
"application/openapi+json;version=3.0"
@ self
The target IRI points to a resource that is a member of the collection represented by the context IRI...
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,...)