6464 </div >
6565 </ul >
6666 </div >
67- <h3 id =" status-codes" v-if =" statusCodes" >
68- <a href =" #status-codes" class =" header-anchor" >#</a > Status Codes
69- </h3 >
70- <ul v-if =" statusCodes" >
71- <li v-for =" (code, index) in statusCodes" :key =" index" >
72- <strong >{{ code.code }}</strong > -->
73- <!-- <strong>{{ code.title }}</strong>, {{ code.description }} -->
74- <strong >{{ code.title }}</strong >
75- <span v-if =" code.description" >, {{ code.description }}</span >
76- </li >
77- </ul >
78- </div >
79- <h2 id =" schema" v-if =" schemas.length" >
80- <a href =" #schema" class =" header-anchor" >#</a > Schema
81- </h2 >
82- <div class =" md-api_reference_FiraCode" >
83- <div v-for =" (type, entry) in schemas" :key =" entry" >
84- <h3 :id =" type.name" >
85- <router-link :to =" '#' + type.name" class =" header-anchor"
86- >#</router-link
87- >
88- {{ type.name }}
67+ <div v-if =" statusCodes.length" >
68+ <h3 id =" status-codes" >
69+ <a href =" #status-codes" class =" header-anchor" >#</a > Status Codes
8970 </h3 >
9071 <ul >
91- <li >
92- Type:
93- <!-- <code v-if="type.url && type.type">
94- <router-link :to="type.url">{{ type.type }}</router-link>
95- </code> -->
96- <code v-if =" type.$ref" >
97- <router-link
98- :to =" '/api/reference/rest/v1/models/#' + type.$ref"
99- >{{ type.$ref }}</router-link
100- >
101- </code >
102- <code v-else >{{ type.type }}</code >
103- </li >
104-
105- <li v-if =" type.required" >
106- Required:
107- <code class =" required" >{{ type.required }}</code >
108- </li >
109- <li v-if =" type.enum" >
110- Enum: <code >{{ type.enum }}</code >
111- </li >
112- <li v-if =" type.default" >
113- Default: <code >{{ type.default }}</code >
114- </li >
115- <li
116- v-if ="
117- type.minLength &&
118- type.maxLength &&
119- type.minLength === type.maxLength
120- "
121- >
122- Length: <code >{{ type.minLength }}</code >
123- </li >
124- <li v-else-if =" type.minLength" >
125- Length: <code >≥ ; {{ type.minLength }}</code >
126- </li >
127- <li v-else-if =" type.maxLength" >
128- Length: <code >≤ ; {{ type.maxLength }}</code >
129- </li >
130- <li v-if =" type.minimum && type.type === 'integer'" >
131- Value: <code >≥ ; {{ type.minimum }}</code >
132- </li >
133- <li v-if =" type.maximum && type.type === 'integer'" >
134- Value: <code >≤ ; {{ type.maximum }}</code >
135- </li >
136- <li v-if =" type.pattern" >
137- RegExp: <code >{{ type.pattern }}</code >
72+ <li v-for =" (code, index) in statusCodes" :key =" index" >
73+ <strong >{{ code.code }}</strong > -->
74+ <strong >{{ code.title }}</strong
75+ ><span v-if =" code.description" >, {{ code.description }}</span >
13876 </li >
13977 </ul >
140- <p v-if =" type.description" >{{ type.description }}</p >
14178 </div >
14279 </div >
80+ <section v-if =" schemas.length" >
81+ <h2 id =" schema" >
82+ <a href =" #schema" class =" header-anchor" >#</a > Schema
83+ </h2 >
84+ <div class =" md-api_reference_FiraCode" >
85+ <div v-for =" (type, entry) in schemas" :key =" entry" >
86+ <h3 :id =" type.name" >
87+ <router-link :to =" '#' + type.name" class =" header-anchor"
88+ >#</router-link
89+ >
90+ {{ type.name }}
91+ </h3 >
92+ <ul >
93+ <li >
94+ Type:
95+ <!-- <code v-if="type.url && type.type">
96+ <router-link :to="type.url">{{ type.type }}</router-link>
97+ </code> -->
98+ <code v-if =" type.$ref" >
99+ <router-link
100+ :to =" '/api/reference/rest/v1/models/#' + type.$ref"
101+ >{{ type.$ref }}</router-link
102+ >
103+ </code >
104+ <code v-else >{{ type.type }}</code >
105+ </li >
106+
107+ <li v-if =" type.required" >
108+ Required:
109+ <code class =" required" >{{ type.required }}</code >
110+ </li >
111+ <li v-if =" type.enum" >
112+ Enum: <code >{{ type.enum }}</code >
113+ </li >
114+ <li v-if =" type.default" >
115+ Default: <code >{{ type.default }}</code >
116+ </li >
117+ <li
118+ v-if ="
119+ type.minLength &&
120+ type.maxLength &&
121+ type.minLength === type.maxLength
122+ "
123+ >
124+ Length: <code >{{ type.minLength }}</code >
125+ </li >
126+ <li v-else-if =" type.minLength" >
127+ Length: <code >≥ ; {{ type.minLength }}</code >
128+ </li >
129+ <li v-else-if =" type.maxLength" >
130+ Length: <code >≤ ; {{ type.maxLength }}</code >
131+ </li >
132+ <li v-if =" type.minimum && type.type === 'integer'" >
133+ Value: <code >≥ ; {{ type.minimum }}</code >
134+ </li >
135+ <li v-if =" type.maximum && type.type === 'integer'" >
136+ Value: <code >≤ ; {{ type.maximum }}</code >
137+ </li >
138+ <li v-if =" type.pattern" >
139+ RegExp: <code >{{ type.pattern }}</code >
140+ </li >
141+ </ul >
142+ <p v-if =" type.description" >{{ type.description }}</p >
143+ </div >
144+ </div >
145+ </section >
146+
143147 <br />
144148 <!-- <h2 id="code-snippets">
145149 <a href="#code-snippets" class="header-anchor">#</a> Code Snippets
146- </h2>
147- <div class="language-http extra-class">
148- <pre class="language-http code-copy-added">
149- <code>
150- <span class="token request-line"><span class="token property">POST</span> /some/resource/ HTTP/1.1</span>
151- <span class="token header-name keyword">HOST:</span> server.test
152- <span class="token header-name keyword">Accept:</span> application/vnd.mcash.api.merchant.v1+json
153- <span class="token header-name keyword">Content-Type:</span> application/json
154- <span class="token header-name keyword">X-Auka-Merchant:</span> T9oWAQ3FSl6oeITuR2ZGWA
155- <span class="token header-name keyword">X-Auka-User:</span> POS1
156- <span class="token header-name keyword">Authorization:</span> SECRET MySecretPassword
157- </code>
158- </pre>
159- </div> -->
150+ </h2> -->
151+ <Content slot-key =" example" />
152+
160153 <!-- <h2 id="request-body">
161154 <a href="#request-body" class="header-anchor">#</a> Request Body
162155 </h2>
@@ -342,7 +335,7 @@ export default {
342335
343336 if (unsortedShit .length > 0 ) {
344337 uniqSchemas = _ .uniq (unsortedShit);
345- // console.log(uniqSchemas);
338+ // console.log("uniqSchemas", uniqSchemas);
346339 }
347340
348341 if (uniqSchemas !== undefined ) {
@@ -351,18 +344,48 @@ export default {
351344 if (mon .operationId === frontmatter .operationId ) {
352345 // console.log(mon);
353346 _ .filter (mon .responses , function (apu , smithers ) {
354- // console.log(smithers, apu);
355- let title = apu .description .split (" ," )[0 ];
356- let description = apu .description .split (" ," )[1 ];
357- console .log (" code" , title + " :" + description);
347+ let title;
348+ let description;
349+
350+ // console.log("apu", apu.$ref);
351+ if (apu .$ref ) {
352+ console .log (" $ref" , apu .$ref );
353+ let currentResponseRef = apu .$ref .split (
354+ " #/components/responses/"
355+ )[1 ];
356+ console .log (" currentResponseRef: " , currentResponseRef);
357+ // _.filter(reference, function (bart, lisa){})
358+ let response =
359+ reference[page .frontmatter .api ].components .responses [
360+ currentResponseRef
361+ ];
362+ console .log (" response: " , response);
363+ title = response .description ;
364+ if (title .includes (" ," )) {
365+ title = title .split (" ," )[0 ];
366+ description = title .split (" ," )[1 ];
367+ // console.log("code", title + ":" + description);
368+ } else {
369+ title = title;
370+ }
371+ } else {
372+ console .log (" apu" , apu);
373+ title = apu .description ;
374+ if (title .includes (" ," )) {
375+ title = apu .description .split (" ," )[0 ];
376+ description = apu .description .split (" ," )[1 ];
377+ // console.log("code", title + ":" + description);
378+ } else {
379+ title = title;
380+ }
381+ }
358382
359- // let title = apu.description.split(",")[0];
360- // let description = apu.description.split(",")[1];
361383 let code = {
362384 code: smithers,
363385 title: title,
364386 description: description,
365387 };
388+
366389 data .statusCodes .push (code);
367390 });
368391 //
0 commit comments