Skip to content

Commit

Permalink
Boolean query parameter with false example is not displayed in input
Browse files Browse the repository at this point in the history
  • Loading branch information
Carolina Wright authored and Carolina Wright committed Jan 8, 2018
1 parent 1750fae commit 7638671
Show file tree
Hide file tree
Showing 9 changed files with 31,929 additions and 14 deletions.
17 changes: 10 additions & 7 deletions dist/scripts/api-console.js
Original file line number Diff line number Diff line change
Expand Up @@ -5543,15 +5543,18 @@ RAML.Inspector = (function() {
if (info) {
Object.keys(info).map(function (key) {
if (typeof field === 'undefined' || field === key) {
if (typeof info[key][0]['enum'] === 'undefined') {
if (info[key][0].type === 'date' && typeof info[key][0].example === 'object') {
info[key][0].example = info[key][0].example.toUTCString();
var parameter = info[key][0];
if (typeof parameter['enum'] === 'undefined') {
if (parameter.type === 'date' && typeof parameter.example === 'object') {
parameter.example = parameter.example.toUTCString();
}

if (info[key][0].example) {
that.values[key][0] = info[key][0].example;
} else if (info[key][0].examples && info[key][0].examples[0] && info[key][0].examples[0].value) {
that.values[key][0] = info[key][0].examples[0].value;
if (parameter.example) {
that.values[key][0] = parameter.example;
} else if (parameter.type === 'boolean' && parameter.hasOwnProperty('example')) {
that.values[key][0] = parameter.example;
} else if (parameter.examples && parameter.examples[0] && parameter.examples[0].value) {
that.values[key][0] = parameter.examples[0].value;
}
}
}
Expand Down
33 changes: 33 additions & 0 deletions src/assets/examples/Financial/Examples/Invoice.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<Invoice type="Invoice" xmlns="http://schema.infor.com/InforOAGIS/2">
<InvoiceHeader>
<DocumentID>
<ID accountingEntity="4012" location="CHK">103001-00</ID>
</DocumentID>
<Description>103001</Description>
<TotalAmount currencyID="USD">29079.6</TotalAmount>
<SupplierParty>
<SalesContact>
<ID>1</ID>
</SalesContact>
</SupplierParty>
<CustomerParty>
<PartyIDs>
<ID>92005</ID>
</PartyIDs>
</CustomerParty>
<PaymentTerm>
<Term>
<ID>2/15 NT 60</ID>
</Term>
</PaymentTerm>
<Tax/>
<Charge/>
<UserArea/>
<Status/>
<BillToParty>
<PartyIDs>
<ID>092005</ID>
</PartyIDs>
</BillToParty>
</InvoiceHeader>
</Invoice>
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<SourceSystemJournalEntry xmlns="http://schema.infor.com/InforOAGIS/2">
<JournalEntryHeader>
<JournalID accountingEntity="KICT@@1085">CNCR032017061216470302@1085</JournalID>
<BaseJournalEntryHeader>
<UserArea>
<Property>
<NameValue name="gfc.FinanceEnterpriseGroup" type="StringType">KICT</NameValue>
</Property>
<Property>
<NameValue name="GeneralLedgerSystemCode" type="StringType">TE</NameValue>
</Property>
<Koch>
<KOCH_CSF>
<KICTRunGroup>CNCR032017061216470302|1085</KICTRunGroup>
</KOCH_CSF>
</Koch>
</UserArea>
<JournalUsage listID="Cancellation">False</JournalUsage>
</BaseJournalEntryHeader>
</JournalEntryHeader>
<JournalEntryLine sequence="0">
<Amount currencyID="USD">-4.60</Amount>
<GLAccount>
<GLNominalAccount>37110102</GLNominalAccount>
</GLAccount>
<DimensionCodes>
<DimensionCode listID="Finance 3 Dimensions"></DimensionCode>
<DimensionCode listID="Finance 4 Dimensions"></DimensionCode>
<DimensionCode listID="Finance 5 Dimensions"></DimensionCode>
<DimensionCode listID="Projects"></DimensionCode>
</DimensionCodes>
<UserArea>
<Koch>
<KOCH_CSF>
<KICTTaxJurisdiction></KICTTaxJurisdiction>
</KOCH_CSF>
</Koch>
</UserArea>
<SourceAccountingDate>
<PostDateTime>2017-06-12T05:00:00.000Z</PostDateTime>
</SourceAccountingDate>
<Description>T &amp; E Out of Pocket Expense</Description>
<ExchangeRateDateTime>2017-06-12T05:00:00.000Z</ExchangeRateDateTime>
</JournalEntryLine>
<JournalEntryLine sequence="1">
<Amount currencyID="USD">4.60</Amount>
<GLAccount>
<GLNominalAccount>84310100</GLNominalAccount>
</GLAccount>
<DimensionCodes>
<DimensionCode listID="Finance 3 Dimensions"></DimensionCode>
<DimensionCode listID="Finance 4 Dimensions"></DimensionCode>
<DimensionCode listID="Finance 5 Dimensions">04987</DimensionCode>
<DimensionCode listID="Projects"></DimensionCode>
</DimensionCodes>
<UserArea>
<Koch>
<KOCH_CSF>
<KICTTaxJurisdiction></KICTTaxJurisdiction>
</KOCH_CSF>
</Koch>
</UserArea>
<SourceAccountingDate>
<PostDateTime>2017-06-12T05:00:00.000Z</PostDateTime>
</SourceAccountingDate>
<Description>T &amp; E Out of Pocket Expense</Description>
<ExchangeRateDateTime>2017-06-12T05:00:00.000Z</ExchangeRateDateTime>
</JournalEntryLine>
</SourceSystemJournalEntry>
30 changes: 30 additions & 0 deletions src/assets/examples/Financial/Examples/SupplierInvoice.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<SupplierInvoice xmlns="http://schema.infor.com/InforOAGIS/2">
<SupplierInvoiceHeader>
<DocumentID>
<ID accountingEntity="4749" location="INTF">7315</ID>
</DocumentID>
<DocumentDateTime>2016-01-13T06:00:00.000Z</DocumentDateTime>
<Description>2015Property Tax</Description>
<TotalAmount currencyID="USD">3896.46</TotalAmount>
<SupplierParty>
<PartyIDs>
<ID>5730</ID>
</PartyIDs>
</SupplierParty>
<RemitToParty>
<PartyIDs>
<ID>5730</ID>
</PartyIDs>
<Location>
<ID>LAKE JACKSON02</ID>
</Location>
</RemitToParty>
<PaymentTerm>
<Term>
<ID>IMMEDIATE</ID>
</Term>
</PaymentTerm>
<UserArea/>
<Status/>
</SupplierInvoiceHeader>
</SupplierInvoice>
112 changes: 112 additions & 0 deletions src/assets/examples/Financial/FinancialAPI.raml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
#%RAML 1.0
baseUri: https://mocksvc.mulesoft.com/mocks/36ccaefb-1ce6-41f1-9567-17ebc4c78ec2
title: Financial API
version: 1.0

/APInvoice:
displayName: AP Invoice processing
post:
description: Post AP Invoice to Infor CSF
body:
application/xml:
schema: !include Schemas/SupplierInvoice.xsd
responses:
201:
body:
application/json:
example: |
{
"RunGroup" : "CNCR012017092514502320202|3036",
"TransactionReference" : "192f0dc0-8d00-11e7-9598-0800200c9a66",
"Status" : "Success",
"Reason" : "Your AR Invoice has been sent to Infor -- Not Really"
}
400:
body:
application/json:
example: |
{
"RunGroup" : "CNCR052017092514502320202|3036",
"TransactionReference" : "",
"Status" : "Failed",
"Reason" : "error message here"
}
/ARInvoice:
displayName: AR Invoice processing
post:
description: Post AR Invoice to Infor CSF
body:
application/xml:
schema: !include Schemas/Invoice.xsd

responses:
201:
body:
application/json:
example: |
{
"RunGroup" : "CNCR012017092514502320202|3036",
"TransactionReference" : "192f0dc0-8d00-11e7-9598-0800200c9a66",
"Status" : "Success",
"Reason" : "Your Receivables invoice has been sent to Infor -- Not Really"
}
400:
body:
application/json:
example: |
{
"RunGroup" : "CNCR052017092514502320202|3036",
"TransactionReference" : "",
"Status" : "Failed",
"Reason" : "error message here"
}
/GLEntries:
displayName: GL Journal Entry processing
post:
description: Post GL Journal Entries to Infor CSF
body:
application/xml:
schema: !include Schemas/SourceSystemJournalEntry.xsd
example: !include Examples/SourceSystemJournalEntry.xml

responses:
201:
body:
application/json:
example: |
{
"RunGroup" : "CNCR052017092514502320202|3036",
"TransactionReference" : "192f0dc0-8d00-11e7-9598-0800200c9a66",
"Status" : "Success",
"Reason" : "Your Journal Entry has been sent to Infor -- Not Really"
}
400:
body:
application/json:
example: |
{
"RunGroup" : "CNCR052017092514502320202|3036",
"TransactionReference" : "",
"Status" : "Failed",
"Reason" : "error message here"
}
/Ping:
displayName: Is Available Check
get:
description: Checks to see if FinAPI is available or not

responses:
200:
body:
text/plain:
example: "true"
503:
body:
text/plain:
example: "false"
Loading

0 comments on commit 7638671

Please sign in to comment.