Skip to content
Permalink
Browse files

De-duplicate flow documentation error reasons on a per-code basis

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=250894847
  • Loading branch information...
gbrodman authored and CydeWeys committed May 31, 2019
1 parent e489539 commit 79bcb227bec2da31cb560d6c721b0748ba696a68
Showing with 12 additions and 12 deletions.
  1. +0 −3 docs/flows.md
  2. +12 −9 java/google/registry/documentation/MarkdownDocumentationFormatter.java
@@ -27,7 +27,6 @@ An EPP flow that creates a new contact.
* Internationalized postal infos can only contain ASCII characters.
* 2302
* Resource with this id already exists.
* Resource with this id already exists.
* 2306
* Declining contact disclosure is disallowed by server policy.

@@ -342,7 +341,6 @@ An EPP flow that creates a new domain resource.
* Registrar must be active in order to perform this operation.
* 2302
* Resource with this id already exists.
* Resource with this id already exists.
* 2303
* Resource linked to this domain does not exist.
* 2304
@@ -825,7 +823,6 @@ allows creating a host name, and if necessary enqueues tasks to update DNS.
* Host names must be puny-coded.
* 2302
* Resource with this id already exists.
* Resource with this id already exists.
* 2303
* Superordinate domain for this hostname does not exist.
* 2304
@@ -163,15 +163,18 @@ public static String generateMarkdownOutput(Iterable<FlowDocumentation> flowDocs
for (Long code : flowDoc.getErrorsByCode().keySet()) {
output.append(String.format("* %d\n", code));


for (ErrorCase error : flowDoc.getErrorsByCode().get(code)) {
output.append(" * ");
String wrappedReason = reflow(fixHtml(error.getReason()), LINE_WIDTH - 8);

// Replace internal newlines with indentation and strip the final newline.
output.append(wrappedReason.trim().replace("\n", "\n" + INDENT8));
output.append('\n');
}
flowDoc.getErrorsByCode().get(code).stream()
.map(ErrorCase::getReason)
.distinct()
.forEach(
reason -> {
output.append(" * ");
String wrappedReason = reflow(fixHtml(reason), LINE_WIDTH - 8);

// Replace internal newlines with indentation and strip the final newline.
output.append(wrappedReason.trim().replace("\n", "\n" + INDENT8));
output.append('\n');
});
}
output.append('\n');
}

0 comments on commit 79bcb22

Please sign in to comment.
You can’t perform that action at this time.