| GET | /test | Simple test method to confirm the services are working |
|---|
import 'package:servicestack/servicestack.dart';
class TestResult implements IConvertible
{
bool? wasSuccessful;
String? description;
TestResult({this.wasSuccessful,this.description});
TestResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
wasSuccessful = json['wasSuccessful'];
description = json['description'];
return this;
}
Map<String, dynamic> toJson() => {
'wasSuccessful': wasSuccessful,
'description': description
};
getTypeName() => "TestResult";
TypeContext? context = _ctx;
}
class TestResponse implements IConvertible
{
String? environment;
Map<String,TestResult?>? tests;
bool? wasSuccessful;
String? db;
TestResponse({this.environment,this.tests,this.wasSuccessful,this.db});
TestResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
environment = json['environment'];
tests = JsonConverters.fromJson(json['tests'],'Map<String,TestResult?>',context!);
wasSuccessful = json['wasSuccessful'];
db = json['db'];
return this;
}
Map<String, dynamic> toJson() => {
'environment': environment,
'tests': JsonConverters.toJson(tests,'Map<String,TestResult?>',context!),
'wasSuccessful': wasSuccessful,
'db': db
};
getTypeName() => "TestResponse";
TypeContext? context = _ctx;
}
class Test implements IConvertible
{
/**
* An email address a test email will be sent to
*/
// @ApiMember(Description="An email address a test email will be sent to")
String? smtp;
Test({this.smtp});
Test.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
smtp = json['smtp'];
return this;
}
Map<String, dynamic> toJson() => {
'smtp': smtp
};
getTypeName() => "Test";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'cochraneplus_api_dev.happen.zone', types: <String, TypeInfo> {
'TestResult': TypeInfo(TypeOf.Class, create:() => TestResult()),
'TestResponse': TypeInfo(TypeOf.Class, create:() => TestResponse()),
'Map<String,TestResult?>': TypeInfo(TypeOf.Class, create:() => Map<String,TestResult?>()),
'Test': TypeInfo(TypeOf.Class, create:() => Test()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /test HTTP/1.1 Host: cochraneplus-api-dev.happen.zone Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
environment: String,
tests:
{
String:
{
wasSuccessful: False,
description: String
}
},
wasSuccessful: False,
db: String
}