phoenixnap / springmvc-raml-plugin

Spring MVC - RAML Spec Synchroniser Plugin. A Maven plugin designed to Generate Server & Client code in Spring from a RAML API descriptor and conversely, a RAML API document from the SpringMVC Server implementation.
Apache License 2.0
136 stars 84 forks source link

Option to skip type's attribute from toString #247

Closed stojsavljevic closed 6 years ago

stojsavljevic commented 6 years ago

In some cases certain attribute of data type might be sensitive so it should be excluded from toString method.

The only way to support this is to introduce custom annotation on type declaration that will mark fields as sensitive:

annotationTypes: 
  isSensitive:
    type: boolean
    allowedTargets: TypeDeclaration

types:
  User: # kind can equal `User`; default value for `discriminatorValue`
    type: object
    properties:
      userId:
        type: integer
      salary:
        type: integer
        (isSensitive): true

So, the plugin will recognize annotation called isSensitive and will skip annotated attribute from toString method.