Test

<back to all web services

MetadataTest

The following routes are available for this service:
All Verbs/metadatatest
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class MetadataTestNestedChild implements IConvertible
{
    String? name;

    MetadataTestNestedChild({this.name});
    MetadataTestNestedChild.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        name = json['name'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'name': name
    };

    getTypeName() => "MetadataTestNestedChild";
    TypeContext? context = _ctx;
}

class MetadataTestChild implements IConvertible
{
    String? name;
    List<MetadataTestNestedChild>? results;

    MetadataTestChild({this.name,this.results});
    MetadataTestChild.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        name = json['name'];
        results = JsonConverters.fromJson(json['results'],'List<MetadataTestNestedChild>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'name': name,
        'results': JsonConverters.toJson(results,'List<MetadataTestNestedChild>',context!)
    };

    getTypeName() => "MetadataTestChild";
    TypeContext? context = _ctx;
}

class MetadataTestResponse implements IConvertible
{
    int? id;
    List<MetadataTestChild>? results;

    MetadataTestResponse({this.id,this.results});
    MetadataTestResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        results = JsonConverters.fromJson(json['results'],'List<MetadataTestChild>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'results': JsonConverters.toJson(results,'List<MetadataTestChild>',context!)
    };

    getTypeName() => "MetadataTestResponse";
    TypeContext? context = _ctx;
}

class MetadataTest implements IConvertible
{
    int? id;

    MetadataTest({this.id});
    MetadataTest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id
    };

    getTypeName() => "MetadataTest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'test.servicestack.net', types: <String, TypeInfo> {
    'MetadataTestNestedChild': TypeInfo(TypeOf.Class, create:() => MetadataTestNestedChild()),
    'MetadataTestChild': TypeInfo(TypeOf.Class, create:() => MetadataTestChild()),
    'List<MetadataTestNestedChild>': TypeInfo(TypeOf.Class, create:() => <MetadataTestNestedChild>[]),
    'MetadataTestResponse': TypeInfo(TypeOf.Class, create:() => MetadataTestResponse()),
    'List<MetadataTestChild>': TypeInfo(TypeOf.Class, create:() => <MetadataTestChild>[]),
    'MetadataTest': TypeInfo(TypeOf.Class, create:() => MetadataTest()),
});

Dart MetadataTest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /metadatatest HTTP/1.1 
Host: test.servicestack.net 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"id":0}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"id":0,"results":[{"name":"String","results":[{"name":"String"}]}]}