Skip to content

Is there a way to access to the fullKeyList ? #8

@cedricvaneer

Description

@cedricvaneer

Hello,

I need to load the keys dynamically so I would loop over a struct to get the keys to load.
But I could have the same key at multiple locations in my struct.
So I need to be able to detect if my current key is already defined in my serializer to avoid throwing an exception.

Here is part of my code :

serializer = new JSONSerializer()
    .asInteger( "clientId" )
    .asInteger( "dateEnd" )
    .asInteger( "dateStart" )
    .asString( "publishTarget" )
    .asString( "ip" )
    .asString( "language" )
    ...
;

for (key in struct){
    if (NOT structKeyExists( serializer.fullKeyList, key)){
        serializer = serializer.asAny(key);
    }
}

Is the fullKeyList available outside the component or do I have to add a getter ?

Cédric

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions