Skip to content

Commit d494595

Browse files
committed
Merge branch 'hotfix-3.7.6' into stable
2 parents e8c1550 + 470c2b8 commit d494595

File tree

3 files changed

+59
-56
lines changed

3 files changed

+59
-56
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v3.7.6
4+
5+
* [#94](https://github.com/pixl8/preside-ext-data-api/issues/94) Support output of multipart/form-data post body specs in the HTML docs
6+
37
## v3.7.5
48

59
* Support CSP changes in Preside

views/dataApiHtmlDocs/_requestBody.cfm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<cfoutput>
99
<cfloop collection="#schemas#" item="schema" index="schemaName">
10-
<cfif schemaName == "application/json"><!-- TODO: support more schemas -->
10+
<cfif ArrayFindNoCase( ["application/json", "multipart/form-data" ], schemaName )><!-- TODO: support more schemas -->
1111
<div class="api-doc-method-params api-doc-method-params-request-body">
1212
<h4 class="api-doc-params-title">#title#: <span class="api-docs-params-title-schema">#schemaName#</span></h4>
1313
<cfif Len( Trim( requestBody.description ?: "" ) )>

views/dataApiHtmlDocs/_schema.cfm

Lines changed: 54 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,60 @@
2727
</cfscript>
2828

2929
<cfoutput>
30-
<cfif StructKeyExists( schema, "type" )>
30+
<cfif StructKeyExists( schema, "properties" )>
31+
<cfset requiredProps = schema.required ?: []/>
32+
33+
<cfif !isInArray>
34+
<div class="api-doc-schema">
35+
<div class="api-doc-schema-type api-doc-schema-type-object">
36+
<span class="api-doc-schema-type-type">Object:</span>
37+
</cfif>
38+
39+
<table class="api-doc-spec-fields-table table">
40+
<tbody>
41+
<cfloop array="#requiredProps#" index="i" item="propName">
42+
<cfif !StructKeyExists( schema.properties, propName )>
43+
<cfcontinue />
44+
</cfif>
45+
<tr>
46+
<td kind="field" title="#HtmlEditFormat( propName )#">
47+
#propName#
48+
<em class="api-doc-params-required">#requiredTitle#</em>
49+
</td>
50+
<td>
51+
#renderView( view="/dataApiHtmlDocs/_schema", args={
52+
spec = spec
53+
, schema = schema.properties[ propName ]
54+
, description = schema.properties[ propName ].description ?: ""
55+
} )#
56+
</td>
57+
</tr>
58+
</cfloop>
59+
<cfloop collection="#schema.properties#" index="propName" item="prop">
60+
<cfif requiredProps.findNoCase( propName )>
61+
<cfcontinue />
62+
</cfif>
63+
<tr>
64+
<td kind="field" title="#HtmlEditFormat( propName )#">
65+
#propName#
66+
</td>
67+
<td>
68+
#renderView( view="/dataApiHtmlDocs/_schema", args={
69+
spec = spec
70+
, schema = prop
71+
, description = prop.description ?: ""
72+
} )#
73+
</td>
74+
</tr>
75+
</cfloop>
76+
</tbody>
77+
</table>
78+
79+
<cfif !isInArray>
80+
</div>
81+
</div>
82+
</cfif>
83+
<cfelseif StructKeyExists( schema, "type" )>
3184
<cfswitch expression="#schema.type#">
3285
<cfcase value="array">
3386

@@ -85,59 +138,5 @@
85138
</div>
86139
</cfdefaultcase>
87140
</cfswitch>
88-
<cfelseif StructKeyExists( schema, "properties" )>
89-
<cfset requiredProps = schema.required ?: []/>
90-
91-
<cfif !isInArray>
92-
<div class="api-doc-schema">
93-
<div class="api-doc-schema-type api-doc-schema-type-object">
94-
<span class="api-doc-schema-type-type">Object:</span>
95-
</cfif>
96-
97-
<table class="api-doc-spec-fields-table table">
98-
<tbody>
99-
<cfloop array="#requiredProps#" index="i" item="propName">
100-
<cfif !StructKeyExists( schema.properties, propName )>
101-
<cfcontinue />
102-
</cfif>
103-
<tr>
104-
<td kind="field" title="#HtmlEditFormat( propName )#">
105-
#propName#
106-
<em class="api-doc-params-required">#requiredTitle#</em>
107-
</td>
108-
<td>
109-
#renderView( view="/dataApiHtmlDocs/_schema", args={
110-
spec = spec
111-
, schema = schema.properties[ propName ]
112-
, description = schema.properties[ propName ].description ?: ""
113-
} )#
114-
</td>
115-
</tr>
116-
</cfloop>
117-
<cfloop collection="#schema.properties#" index="propName" item="prop">
118-
<cfif requiredProps.findNoCase( propName )>
119-
<cfcontinue />
120-
</cfif>
121-
<tr>
122-
<td kind="field" title="#HtmlEditFormat( propName )#">
123-
#propName#
124-
</td>
125-
<td>
126-
#renderView( view="/dataApiHtmlDocs/_schema", args={
127-
spec = spec
128-
, schema = prop
129-
, description = prop.description ?: ""
130-
} )#
131-
</td>
132-
</tr>
133-
</cfloop>
134-
</tbody>
135-
</table>
136-
137-
<cfif !isInArray>
138-
</div>
139-
</div>
140-
</cfif>
141-
142141
</cfif>
143142
</cfoutput>

0 commit comments

Comments
 (0)