Skip to content

Commit

Permalink
feat: html in descriptions, better display of long enums and can quer…
Browse files Browse the repository at this point in the history
…y with array of numbers
  • Loading branch information
nicolas-bonnel committed Feb 23, 2017
1 parent 350a715 commit cb18d4d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions OpenApi.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
<md-table-body>
<md-table-row v-for="parameter in selectedEntry.parameters">
<md-table-cell>{{parameter.name}}</md-table-cell>
<md-table-cell>{{parameter.description}}</md-table-cell>
<md-table-cell v-html="parameter.description"></md-table-cell>
<md-table-cell v-if="parameter.schema.type !== 'array'">{{parameter.schema.type}}</md-table-cell>
<md-table-cell v-if="parameter.schema.type === 'array'">{{toDash(parameter.style)}} {{parameter.schema.items.type}}</md-table-cell>
<md-table-cell v-if="parameter.schema.type !== 'array' && parameter.schema.enum">{{parameter.schema.enum.join(', ')}}</md-table-cell>
<md-table-cell v-if="parameter.schema.type !== 'array' && !parameter.schema.enum"></md-table-cell>
<md-table-cell v-if="parameter.schema.type === 'array' && parameter.schema.items.enum">{{parameter.schema.items.enum.join(', ')}}</md-table-cell>
<md-table-cell v-if="parameter.schema.type === 'array'"><div style="overflow-y:scroll;max-height:200px;">{{(parameter.schema.items.enum || []).join(', ')}}</div></md-table-cell>
<md-table-cell>{{parameter.in}}</md-table-cell>
<md-table-cell>
<md-checkbox v-model="parameter.required" disabled></md-checkbox>
Expand Down Expand Up @@ -111,7 +111,7 @@
<h2>Request</h2>
<form novalidate @submit.stop.prevent="submit" v-if="selectedEntry" id="request-form">
<div v-for="parameter in selectedEntry.parameters">
<md-input-container v-if="(parameter.schema.type === 'string' || parameter.schema.type === 'number') && !parameter.schema.enum">
<md-input-container v-if="(parameter.schema.type === 'string' || parameter.schema.type === 'integer' || parameter.schema.type === 'number') && !parameter.schema.enum">
<label>{{parameter.description}}</label>
<md-input v-model="currentRequest[parameter.name]" :type="parameter.schema.type === 'string' ? 'text' : 'number'" :placeholder="parameter.name"></md-input>
</md-input-container>
Expand All @@ -129,6 +129,13 @@
<md-option v-for="val in parameter.schema.items.enum" :value="val">{{val}}</md-option>
</md-select>
</md-input-container>

<md-chips v-model="currentRequest[parameter.name]" :md-input-placeholder="parameter.name" :md-input-type="parameter.schema.items.type" v-if="parameter.schema.type === 'array' && !parameter.schema.items.enum">
<template scope="chip">{{ chip.value }}</template>
</md-chips>

<md-checkbox v-if="parameter.schema.type === 'boolean'" v-model="currentRequest[parameter.name]">{{parameter.name}}<md-tooltip md-direction="top">{{parameter.description}}</md-tooltip></md-checkbox>

</div>
</form>
<md-layout>
Expand Down

0 comments on commit cb18d4d

Please sign in to comment.