44 if ( mRequired && !QUrlQuery( context.
request()->
url() ).hasQueryItem( mName ) )
51 if ( QUrlQuery( context.
request()->
url() ).hasQueryItem( mName ) )
53 value = QUrlQuery( context.
request()->
url() ).queryItemValue( mName, QUrl::FullyDecoded );
55 else if ( mDefaultValue.isValid() )
57 value = mDefaultValue;
60 if (
value.isValid() )
64 const QVariant::Type targetType {
static_cast< QVariant::Type
>( mType )};
70 if (
value.type() != targetType )
73 if (
value.canConvert(
static_cast<int>( targetType ) ) )
103 if ( mCustomValidator && ! mCustomValidator( context,
value ) )
The QgsServerApiContext class encapsulates the resources for a particular client request: the request...
const QgsServerRequest * request() const
Returns the server request object.
QgsServerQueryStringParameter(const QString name, bool required=false, Type type=QgsServerQueryStringParameter::Type::String, const QString &description=QString(), const QVariant &defaultValue=QVariant())
Constructs a QgsServerQueryStringParameter object.