This repository was archived by the owner on Dec 19, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 13 files changed +66
-17
lines changed
spring-auto-restdocs-core
spring-auto-restdocs-example
src/main/java/capital/scalable/restdocs/example
spring-auto-restdocs-json-doclet
src/test/java/capital/scalable/restdocs/jsondoclet Expand file tree Collapse file tree 13 files changed +66
-17
lines changed Original file line number Diff line number Diff line change 1+ language : java
2+
3+ jdk :
4+ - oraclejdk8
5+ - oraclejdk7
6+
7+ before_install :
8+ - mvn install:install-file -Dfile=lib/spring-restdocs-core-1.1.2.RELEASE-test.jar
9+ -DgroupId=org.springframework.restdocs -DartifactId=spring-restdocs-core
10+ -Dversion=1.1.2.RELEASE -Dpackaging=jar -Dclassifier=test
Original file line number Diff line number Diff line change 11# Spring Auto REST Docs
2+ [ ![ Apache License 2] ( https://img.shields.io/badge/license-ASF2-blue.svg )] ( https://www.apache.org/licenses/LICENSE-2.0.txt )
3+ [ ![ Build Status] ( https://travis-ci.org/ScaCap/spring-auto-restdocs.svg?branch=master.svg?branch=master )] ( https://travis-ci.org/ScaCap/spring-auto-restdocs.svg?branch=master )
24
35** Full documentation at https://scacap.github.io/spring-auto-restdocs **
46
Original file line number Diff line number Diff line change 8989 <groupId >org.apache.maven.plugins</groupId >
9090 <artifactId >maven-compiler-plugin</artifactId >
9191 <configuration >
92- <source >${maven.compiler.source } </source >
93- <target >${maven.compiler.target } </target >
92+ <source >${java.version } </source >
93+ <target >${java.version } </target >
9494 </configuration >
9595 </plugin >
9696 <plugin >
Original file line number Diff line number Diff line change 7777 <groupId >javax.el</groupId >
7878 <artifactId >javax.el-api</artifactId >
7979 </dependency >
80+ <dependency >
81+ <groupId >javax.servlet</groupId >
82+ <artifactId >javax.servlet-api</artifactId >
83+ <version >3.1.0</version >
84+ <scope >provided</scope >
85+ </dependency >
8086 <dependency >
8187 <groupId >org.slf4j</groupId >
8288 <artifactId >slf4j-simple</artifactId >
Original file line number Diff line number Diff line change 7171 <artifactId >spring-auto-restdocs-core</artifactId >
7272 <version >${project.version} </version >
7373 </dependency >
74- <dependency >
75- <groupId >org.javamoney</groupId >
76- <artifactId >moneta</artifactId >
77- <version >1.0</version >
78- </dependency >
7974 <dependency >
8075 <groupId >org.springframework.data</groupId >
8176 <artifactId >spring-data-commons</artifactId >
Original file line number Diff line number Diff line change 3030
3131import capital .scalable .restdocs .example .items .ItemResponse .Attributes ;
3232import capital .scalable .restdocs .example .items .ItemResponse .Metadata ;
33- import org .javamoney .moneta .Money ;
3433import org .springframework .data .domain .Page ;
3534import org .springframework .data .domain .PageImpl ;
3635import org .springframework .http .HttpStatus ;
Original file line number Diff line number Diff line change 3333import lombok .Value ;
3434import org .hibernate .validator .constraints .NotBlank ;
3535import org .hibernate .validator .constraints .NotEmpty ;
36- import org .javamoney .moneta .Money ;
3736
3837/**
3938 * Java object for a single JSON item.
Original file line number Diff line number Diff line change 1+ package capital .scalable .restdocs .example .items ;
2+
3+ import java .math .BigDecimal ;
4+
5+ /**
6+ * Simplified version of Java Money (JDK8 only) to demonstrate custom serializers.
7+ */
8+ public class Money {
9+
10+ private final String currencyCode ;
11+
12+ private final BigDecimal number ;
13+
14+ private Money (BigDecimal number , String currencyCode ) {
15+ this .currencyCode = currencyCode ;
16+ this .number = number ;
17+ }
18+
19+ public String getCurrencyCode () {
20+ return currencyCode ;
21+ }
22+
23+ public BigDecimal getNumberStripped () {
24+ if (this .number .signum () == 0 ) {
25+ return BigDecimal .ZERO ;
26+ }
27+ return this .number .stripTrailingZeros ();
28+ }
29+
30+ public static Money of (BigDecimal number , String currencyCode ) {
31+ return new Money (number , currencyCode );
32+ }
33+ }
Original file line number Diff line number Diff line change 1616
1717package capital .scalable .restdocs .example .jackson ;
1818
19+ import capital .scalable .restdocs .example .items .Money ;
1920import com .fasterxml .jackson .annotation .JsonAutoDetect ;
2021import com .fasterxml .jackson .databind .ObjectMapper ;
2122import com .fasterxml .jackson .databind .module .SimpleModule ;
22- import org .javamoney .moneta .Money ;
2323import org .springframework .context .annotation .Bean ;
2424import org .springframework .context .annotation .Configuration ;
2525
You can’t perform that action at this time.
0 commit comments