Polish "Propagate ignoreUndocumentedParamteres with .and()"

See gh-676
This commit is contained in:
Andy Wilkinson
2020-09-01 13:54:39 +01:00
parent eac7d67c4e
commit ffe4c93c38
5 changed files with 28 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2019 the original author or authors.
* Copyright 2014-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -148,8 +148,14 @@ public abstract class AbstractParametersSnippet extends TemplatedSnippet {
return this.descriptorsByName;
}
/**
* Returns whether to ignore undocumented parameters.
* @return {@code true} if undocumented parameters should be ignored, otherwise
* {@code false}
* @since 2.0.5
*/
protected final boolean isIgnoreUndocumentedParameters() {
return ignoreUndocumentedParameters;
return this.ignoreUndocumentedParameters;
}
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2019 the original author or authors.
* Copyright 2014-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -170,7 +170,7 @@ public class PathParametersSnippet extends AbstractParametersSnippet {
public final PathParametersSnippet and(List<ParameterDescriptor> additionalDescriptors) {
List<ParameterDescriptor> combinedDescriptors = new ArrayList<>(getParameterDescriptors().values());
combinedDescriptors.addAll(additionalDescriptors);
return new PathParametersSnippet(combinedDescriptors, this.getAttributes());
return new PathParametersSnippet(combinedDescriptors, this.getAttributes(), isIgnoreUndocumentedParameters());
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2019 the original author or authors.
* Copyright 2014-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -133,7 +133,8 @@ public class RequestParametersSnippet extends AbstractParametersSnippet {
public RequestParametersSnippet and(List<ParameterDescriptor> additionalDescriptors) {
List<ParameterDescriptor> combinedDescriptors = new ArrayList<>(getParameterDescriptors().values());
combinedDescriptors.addAll(additionalDescriptors);
return new RequestParametersSnippet(combinedDescriptors, this.getAttributes(), this.isIgnoreUndocumentedParameters());
return new RequestParametersSnippet(combinedDescriptors, this.getAttributes(),
this.isIgnoreUndocumentedParameters());
}
}