This repository was archived by the owner on Jan 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Iinitial set of annotations describing raml 2 java mapping #1
Open
petrochenko-pavel-a
wants to merge
1
commit into
raml-org:master
Choose a base branch
from
petrochenko-pavel-a:patch-1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| #%RAML 1.0 Library | ||
| uses: | ||
| commons: "https://raw.githubusercontent.com/apiregistry/commons/master/commons.raml" | ||
| usage: | | ||
| This library contains set of annotations which may be used to, customize mapping | ||
| of RAML types to Java as well as a set of similar languages (Scala,e.t.c) | ||
| annotationTypes: | ||
| package: | ||
| type: string | ||
| description: | | ||
| This annotation allows to specify desired package name for the generated types | ||
| When applied to type container works as the default package | ||
| name for all types in scope | ||
| allowedTargets: [Library,TypeDeclaration,API,Overlay,Extension] | ||
| primarySuperType: | ||
| type: TypeName | ||
| allowedTargets: TypeDeclaration | ||
| description: | | ||
| When RAML type with multiple super types is mapped to language without | ||
| support for multiple inheritance only one of super types may be used | ||
| as a real super type in the target language. This annotation allows to specify | ||
| the name of super type which should be used as primary super type in this case. | ||
| container: | ||
| type: string | ||
| enum: [array, list, set] | ||
| allowedTargets: [Library,TypeDeclaration,API,Overlay,Extension] | ||
| description: | | ||
| Trivial mapping of RAML array types, is to map them to array types of the target language | ||
| however this behavior is not always desired. This annotation allows to customize | ||
| desired type of the container type when mapping array types. When used on type container | ||
| serves as default for all contained types. | ||
| default: list | ||
| javaName: | ||
| type: string | ||
| description: Allows to specify name of the generated java type or java property | ||
| allowedTargets: [TypeDeclaration] | ||
| implementsExisting: | ||
| type: string[] | ||
| description: | | ||
| Allows to specify additional existing interfaces which should be implemented by type. | ||
| Framework assumes that interface declarations already exists on class path | ||
| allowedTargets: [Library,TypeDeclaration,API,Overlay,Extension] | ||
| extendExisting: | ||
| type: string | ||
| description: | | ||
| Allows to specify existing superclass which should be extended by type. | ||
| Framework assumes that superclass declaration already exists on class path | ||
| allowedTargets: [Library,TypeDeclaration,API,Overlay,Extension] | ||
| mapsToExisting: | ||
| type: string | ||
| description: | | ||
| Allows to specify fully qualified name of existing class which should be mapped to this type | ||
| allowedTargets: [TypeDeclaration] | ||
| defaultNumberFormat: | ||
| description: This annotation allows to configure default java representation for number values | ||
| type: string | ||
| default: double | ||
| enum: [float, long, int, int16,int32, int64, double] | ||
| allowedTargets: [Library,TypeDeclaration,API,Overlay,Extension] | ||
| defaultIntegerFormat: | ||
| description: This annotation allows to configure default java representation for integer values | ||
| type: string | ||
| enum: [long, int, int16, int32, int64, int8] | ||
| default: int | ||
| allowedTargets: [Library,TypeDeclaration,API,Overlay,Extension] | ||
| cloneable: | ||
| type: nil | ||
| description: This marker annotation states that generated types should support cloning | ||
| allowedTargets: [Library,TypeDeclaration,API,Overlay,Extension] | ||
| serializable: | ||
| type: nil | ||
| description: This marker annotation states that generated types should be serializable | ||
| allowedTargets: [Library,TypeDeclaration,API,Overlay,Extension] | ||
| comparable: | ||
| #Not supported yet. | ||
| type: string | ||
| description: | | ||
| This annotation states that generated types should be comparable, | ||
| annotation argument is the name of property which should be used for comparison | ||
| allowedTargets: [Library,TypeDeclaration,API,Overlay,Extension] | ||
| equalsAndHashCode: | ||
| type: nil | ||
| description: | | ||
| This marker annotation states that generated types should have equals and hashCode methods | ||
| which supports comparison by value | ||
| allowedTargets: [Library,TypeDeclaration,API,Overlay,Extension] | ||
| types: | ||
| JavaPackage: string | ||
| TypeName: string | ||
| (commons.Authors): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure about that to be honest. Its kinda additional information that you might want to have for building a separate registry, but there might be better options than putting it into the fragment file. Again, if its not import for the consumer (in this case the application that reads those annotations), I would try to bring in the meta information in a different form. |
||
| - name: Pavel Petrochenko | ||
| email: [email protected] | ||
| profiles: [ "https://github.com/petrochenko-pavel-a/" ] | ||
| (commons.Id): org.aml.java.mapping | ||
| (commons.Version): 0.0.3 | ||
| (commons.Title): RAML2Java Annotations | ||
| (commons.Links): | ||
| - title: RAML2Java Tool | ||
| url: "https://github.com/OnPositive/aml" | ||
| role: Tool Location | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we include the commons RAML in here as well, or what is that exactly. I would argue to minimize the amount of external dependencies.