Home

Awesome

dgs-extended-formatters

Build Status Latest Release Coverage Quality Gate Status Renovate enabled OSS License

A set of DGS Schema Directives for common response formatting use-cases.

Getting started

<dependency>
    <groupId>io.github.setchy</groupId>
    <artifactId>dgs-extended-formatters</artifactId>
    <version>1.0.14</version>
</dependency>

Usage

String Formatters

The following schema directives support formatting String scalars

@abbreviate

Abbreviates a string using ellipses for a given width

@camelcase

Converts the String into camelCase

@capitalize

Capitalize the starting letter for each word in a String

@lowercase

Lowercase all characters in a String

@prefix

Prepends a prefix to a String

@resourceId

Transforms a string into a base64 protobuf opaque ID. This takes in domain, subdomain, and systemName arguments which will be encoded into the ID.

@reverse

Reverse the characters in a String

@suffix

Appends a suffix to a String

@swapcase

Invert the case of each character in a String

@trim

Remove any leading or trailing whitespace

@uppercase

Uppercase each character in a String

Numeric Formatters

The following schema directives support formatting Int or Float scalars

@absolute

Returns the absolute value

@ceiling

Returns the ceiling value

@floor

Returns the floor value

Release Process

Our release process involves

  1. Run the release workflow
  2. Enter the new version number to release
  3. Draft a new release, create a tag that matches the release version from above and publish
<!-- LINK LABELS -->