Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Unique key constrain in json(How can)
Unique key constrain in json [message #1003677] Mon, 21 January 2013 19:06 Go to next message
Mr Manner is currently offline Mr MannerFriend
Messages: 26
Registered: January 2013
Junior Member
I have a grammer to parse/validate json. The root json object can contain a set of allowed keys.
Basic setup:

		(',' members+=Member)*

	GenericMember | VersionMember | LoggingMember;

	'\"version\"' ':' version=STRING;

	'\"file\"' ':' version=STRING; 

	key=STRING ':' value=Value;

How can I ensure that there is only one VersioMember or LoggingMember is allowed.
Re: Unique key constrain in json [message #1003680 is a reply to message #1003677] Mon, 21 January 2013 19:14 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13359
Registered: July 2009
Senior Member
ID write a simple check (yoursdljavavalidator)

Need training, onsite consulting or any other kind of help for Xtext?
Go visit or send a mail to xtext at itemis dot de

Need professional support for Xtext, Xpand, EMF?
Go to:
Twitter : @chrdietrich
Blog :
Re: Unique key constrain in json [message #1007005 is a reply to message #1003680] Sun, 03 February 2013 19:04 Go to previous message
Frank Tagne is currently offline Frank TagneFriend
Messages: 7
Registered: August 2012
Junior Member
You can also use ScopeProvider to propose only the current allowed Member Type after that user has filled 1st Member.

[Updated on: Sun, 03 February 2013 19:05]

Report message to a moderator

Previous Topic:Standalone Java Application
Next Topic:How to build multiple entities in one rule?
Goto Forum:

Current Time: Fri Feb 21 07:42:25 GMT 2020

Powered by FUDForum. Page generated in 0.02145 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top