Fix non-determinism in docsgen (#8456)

This commit is contained in:
Anton Tayanovskyy 2021-11-19 11:23:06 -05:00 committed by GitHub
parent e60d6bf248
commit f98d39b84b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 57 additions and 51 deletions

View file

@ -902,8 +902,14 @@ func (mod *modContext) genNestedTypes(member interface{}, resourceType bool) []d
// and if it appears in an input object and/or output object.
mod.getTypes(member, tokens)
var typs []docNestedType
var sortedTokens []string
for token := range tokens {
sortedTokens = append(sortedTokens, token)
}
sort.Strings(sortedTokens)
var typs []docNestedType
for _, token := range sortedTokens {
for _, t := range mod.pkg.Types {
switch typ := t.(type) {
case *schema.ObjectType:

View file

@ -300,56 +300,6 @@ All [input](#inputs) properties are implicitly available as output properties. A
<h4 id="typ">Typ</h4>
{{% choosable language csharp %}}
<dl class="resources-properties"><dt class="property-optional"
title="Optional">
<span id="val_csharp">
<a href="#val_csharp" style="color: inherit; text-decoration: inherit;">Val</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd></dl>
{{% /choosable %}}
{{% choosable language go %}}
<dl class="resources-properties"><dt class="property-optional"
title="Optional">
<span id="val_go">
<a href="#val_go" style="color: inherit; text-decoration: inherit;">Val</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd></dl>
{{% /choosable %}}
{{% choosable language nodejs %}}
<dl class="resources-properties"><dt class="property-optional"
title="Optional">
<span id="val_nodejs">
<a href="#val_nodejs" style="color: inherit; text-decoration: inherit;">val</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd></dl>
{{% /choosable %}}
{{% choosable language python %}}
<dl class="resources-properties"><dt class="property-optional"
title="Optional">
<span id="val_python">
<a href="#val_python" style="color: inherit; text-decoration: inherit;">val</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">str</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd></dl>
{{% /choosable %}}
<h4 id="typ">Typ</h4>
{{% choosable language csharp %}}
@ -466,6 +416,56 @@ All [input](#inputs) properties are implicitly available as output properties. A
<h4 id="typ">Typ</h4>
{{% choosable language csharp %}}
<dl class="resources-properties"><dt class="property-optional"
title="Optional">
<span id="val_csharp">
<a href="#val_csharp" style="color: inherit; text-decoration: inherit;">Val</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd></dl>
{{% /choosable %}}
{{% choosable language go %}}
<dl class="resources-properties"><dt class="property-optional"
title="Optional">
<span id="val_go">
<a href="#val_go" style="color: inherit; text-decoration: inherit;">Val</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd></dl>
{{% /choosable %}}
{{% choosable language nodejs %}}
<dl class="resources-properties"><dt class="property-optional"
title="Optional">
<span id="val_nodejs">
<a href="#val_nodejs" style="color: inherit; text-decoration: inherit;">val</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd></dl>
{{% /choosable %}}
{{% choosable language python %}}
<dl class="resources-properties"><dt class="property-optional"
title="Optional">
<span id="val_python">
<a href="#val_python" style="color: inherit; text-decoration: inherit;">val</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">str</span>
</dt>
<dd>{{% md %}}{{% /md %}}</dd></dl>
{{% /choosable %}}
<h4 id="typ">Typ</h4>
{{% choosable language csharp %}}
<dl class="resources-properties"><dt class="property-optional"
title="Optional">