All Downloads are FREE. Search and download functionalities are using the official Maven repository.

models.dsl.GitHubUserAPI.rapid Maven / Gradle / Ivy

There is a newer version: 1.4.2
Show newest version
rapidModel GitHubUser
	resourceAPI GitHubUser baseURI "https://api.github.com/repos"
	// GitHub User methods described on http://developer.github.com/v3/users/
		objectResource UserObject type User
		// ZEN-49 the GitHub documentation uses the colon notation (":user") for parameters, 
		// while WADL uses the curly brackets ("{user}"). Should be support both or recommend the WADL notation?
			URI /users/{user}
				required templateParam user property id

			mediaTypes
				application/json
			method GET getUserByID
				response UserObject statusCode 200
				response statusCode 404


		objectResource CurrentUser type User
		//ZEN-49 the user should be authenticated, how shall we show it in our model?
			URI /user 
			mediaTypes
				application/json
			method GET getAuthenticatedUser
			// may include information hidden for other users, e.g. subscription plan
				response CurrentUser statusCode 200 //ZEN-49 EMF/Xtext inconsistency - CurrentUser is the value of Response#resourceType reference
				response statusCode 403

			method PATCH updateAuthenticatedUser
				request CurrentUser // add a new service data type
				/* 
		param name, 
		param email
		param blog
		param company
		param location
		param hireable, 
		param bio
		*/
// ZEN-49 I used parameters because I find it more intuitive, but in the original document the request is in json, 
				// therefore, it should be modeled as the response's resource type
				response UserObject statusCode 200
				response statusCode 403


		collectionResource Users type User
			URI /users
			mediaTypes
				application/json
			method GET getAllUsers
			// This provides a dump of every user, in the order that they signed up for GitHub.
				request
					param since type string // The integer ID of the last User that you’ve seen.

				response CurrentUser statusCode 200


		mediaType application/json 
			specURL "http://www.ietf.org/rfc/rfc4627.txt"

	dataModel GitHubUser
		structure User
			avatar_url : reference Avatar
			url : reference User
			html_url : reference HTMLUser
			id : decimal
			gravatar_id : decimal //ZEN-49 there is no "integer" or "natural" in XSD primitive type, so we have to use decimal
			login : string
			name : string
			company : string
			blog : string
			location : string
			email : string
			hireable : boolean
			bio : string
			public_repos : decimal
			public_gists : decimal
			followers : decimal
			following : decimal
			created_at : dateTime
			type_ : string

		structure HTMLUser

		structure Avatar








© 2015 - 2024 Weber Informatics LLC | Privacy Policy