Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ The project is very much Work In Progress and will be published on maven central

# Release Notes
BOAT is still under development and subject to change.
## 0.15.6
* *Maven Plugin*
* Add example of use the additional properties like createApiComponent
## 0.15.5
* *Boat Lint*
* Bumped version of Zally Linting Libraries that contain several vulnerability fixes
Expand Down
9 changes: 9 additions & 0 deletions boat-maven-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ Same with `generate` but with opinionated defaults for Rest Template Client
</configOptions>
</configuration>

### Sample usage with additional feature

<configuration>
...
<additionalProperties>
<additionalProperty>createApiComponent=false</additionalProperty>
</additionalProperties>
</configuration>

## boat:generate-webclient-embedded

Same with `generate` but with opinionated defaults for Web Client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator;
{{/withXml}}
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
{{#restTemplateBeanName}}
import org.springframework.beans.factory.annotation.Qualifier;
{{/restTemplateBeanName}}
Expand All @@ -31,7 +30,10 @@ import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter;
{{/withXml}}
{{#createApiComponent}}
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
{{/createApiComponent}}
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.util.StringUtils;
Expand Down Expand Up @@ -88,7 +90,9 @@ import {{invokerPackage}}.auth.OAuth;
{{/authMethods}}

{{>generatedAnnotation}}
{{#createApiComponent}}
@Component("{{invokerPackage}}.ApiClient")
{{/createApiComponent}}
public class ApiClient {
public enum CollectionFormat {
CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null);
Expand Down Expand Up @@ -127,11 +131,15 @@ public class ApiClient {
}
{{/useDefaultApiClient}}
{{#useJacksonConversion}}
{{#createApiComponent}}
@Autowired
{{/createApiComponent}}
private ObjectMapper objectMapper;
{{/useJacksonConversion}}

{{#createApiComponent}}
@Autowired
{{/createApiComponent}}
public ApiClient({{#restTemplateBeanName}}@Qualifier("{{restTemplateBeanName}}") {{/restTemplateBeanName}}RestTemplate restTemplate) {
this.restTemplate = restTemplate;
init();
Expand Down