Skip to content

Integer properties are sent as strings #23

@eduard93

Description

@eduard93

My form (simplified):

Class cam.data.Step Extends (%Persistent, Form.Adaptor)
{

Property step As %Integer(DISPLAYNAME = "step");

}

restforms-angular sends:

{
    "step": "2"
}

Instead of:

{
    "step": 2
}
Error from the server:
{
	"errors":[ {
			"code":9406,
			"domain":"%ObjectErrors",
			"error":"ERROR #9406: Unexpected format for value of field, step, using class base mapping",
			"id":"JSONImportError",
			"params":["step","class base"
			]
		}
	],
	"stack": {
		"objlasterror":"ERROR #9406: Unexpected format for value of field, step, using class base mapping",
		"request": {
			"_class":"%CSP.Request",
			"URL":"\/forms\/form\/object\/cam.data.Step\/1",
			"PageName":1,
			"URLPrefix":"",
			"UserAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko\/20100101 Firefox\/91.0",
			"RequestId":"14FD",
			"WebSocketStatus":0,
			"NoResetTimeout":false,
			"ContentType":"application\/json",
			"CharSet":"utf-8",
			"Content":"21@%CSP.BinaryStream",
			"Method":"PUT",
			"Protocol":"HTTP\/1.1",
			"Secure":false,
			"GatewayApplication":"\/",
			"GatewayConnectionName":"LOCAL",
			"GatewaySessionIdSource":3,
			"GatewayNewId":false,
			"GatewayBuild":"661.2001.1740",
			"GatewayFunctions":7,
			"GatewaySessionCookie":"CSPSESSIONID-SP-52773-UP-forms-",
			"GatewayInstanceName":"const3950:52773",
			"RegistryMethods":1,
			"GatewayError":"",
			"Application":"\/forms\/",
			"CSPGatewayRequest":true,
			"GatewayTimeout":60,
			"AppData":"",
			"AppMatch":"\/forms\/",
			"Class":"Form.REST.Main",
			"Service":"REST",
			"ProcessedRequestType":true
		},
		"response": {
			"_class":"%CSP.Response",
			"HTTPVersion":"",
			"Status":"500 Internal Server Error",
			"Redirect":"",
			"ServerSideRedirect":"",
			"ContentType":"application\/json",
			"CharSet":"RAW",
			"CookiePath":"\/forms\/",
			"HeaderCharSet":"",
			"ContentLength":"",
			"NoCharSetConvert":false,
			"UseHttpOnly":true,
			"InProgress":1,
			"Expires":"Thu, 29 Oct 1998 17:04:19 GMT",
			"VaryByParam":"",
			"TraceDump":false,
			"OutputSessionToken":false,
			"UseASPredirect":false,
			"Timeout":"",
			"Language":"en-us",
			"Domain":"%UtilityLogin",
			"GzipOutput":null,
			"IgnoreRESTOutput":null,
			"AllowOutputFlush":0,
			"AvoidPartitionCleanup":false
		},
		"stack":[ {
				"call":"DO",
				"line":" 0",
				"part":""
			}, {
				"call":"DO",
				"line":"SuperServer+55^%SYS.SERVER 3",
				"part":"%SYS.SERVER"
			}, {
				"call":"DO",
				"line":"css+44^%SYS.cspServer2 1",
				"part":"%SYS.cspServer2"
			}, {
				"call":"DO",
				"line":"zProcessRequest+1^%CSP.Request.1 1",
				"part":"%CSP.Request.1"
			}, {
				"call":"DO",
				"line":"Request+25^%SYS.cspServer2 1",
				"part":"%SYS.cspServer2"
			}, {
				"call":"DO",
				"line":"Request+666^%SYS.cspServer2 1",
				"part":"%SYS.cspServer2"
			}, {
				"call":"DO",
				"line":"zProcessRequest+1^%CSP.Session.1 1",
				"part":"%CSP.Session.1"
			}, {
				"call":"DO",
				"line":"CSPDispatch+274^%SYS.cspServer 1",
				"part":"%SYS.cspServer"
			}, {
				"call":"$$",
				"line":"CSPDispatch+484^%SYS.cspServer 2",
				"part":"%SYS.cspServer"
			}, {
				"call":"DO",
				"line":"zPage+32^%CSP.REST.1 1",
				"part":"%CSP.REST.1"
			}, {
				"call":"$$",
				"line":"zHttp500+1^%CSP.REST.1 1",
				"part":"%CSP.REST.1"
			}, {
				"call":"DO",
				"line":"zReportHttpStatusCode+2^%CSP.REST.1 2",
				"part":"%CSP.REST.1"
			}, {
				"call":"$$",
				"line":"zoutputStatus+6^Form.REST.Abstract.1 1",
				"part":"Form.REST.Abstract.1"
			}, {
				"call":"$$",
				"line":"zgetDebugInfo+2^Form.REST.Abstract.1 1",
				"part":"Form.REST.Abstract.1"
			}, {
				"call":"$$",
				"line":"zgetStackInfo+1^Form.REST.Abstract.1 1",
				"part":"Form.REST.Abstract.1"
			}
		],
		"user":"Admin"
	},
	"summary":"ERROR #9406: Unexpected format for value of field, step, using class base mapping"
}

Installed restforms-angular with:

zpm "install restforms2"
zpm "install restforms2-ui"
do ##class(Form.Util.Init).populateTestForms(100)

On IRIS for Windows (x86-64) 2020.1 (Build 215U) Mon Mar 30 2020 20:14:33 EDT

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions