本文整理匯總了Golang中github.com/go-openapi/swag.ConcatJSON函數的典型用法代碼示例。如果您正苦於以下問題:Golang ConcatJSON函數的具體用法?Golang ConcatJSON怎麽用?Golang ConcatJSON使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ConcatJSON函數的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: MarshalJSON
// MarshalJSON marshal this to JSON
func (s Schema) MarshalJSON() ([]byte, error) {
b1, err := json.Marshal(s.SchemaProps)
if err != nil {
return nil, fmt.Errorf("schema props %v", err)
}
b2, err := json.Marshal(s.VendorExtensible)
if err != nil {
return nil, fmt.Errorf("vendor props %v", err)
}
b3, err := s.Ref.MarshalJSON()
if err != nil {
return nil, fmt.Errorf("ref prop %v", err)
}
b4, err := s.Schema.MarshalJSON()
if err != nil {
return nil, fmt.Errorf("schema prop %v", err)
}
b5, err := json.Marshal(s.SwaggerSchemaProps)
if err != nil {
return nil, fmt.Errorf("common validations %v", err)
}
var b6 []byte
if s.ExtraProps != nil {
jj, err := json.Marshal(s.ExtraProps)
if err != nil {
return nil, fmt.Errorf("extra props %v", err)
}
b6 = jj
}
return swag.ConcatJSON(b1, b2, b3, b4, b5, b6), nil
}
示例2: MarshalJSON
// MarshalJSON marshal this to JSON
func (i Info) MarshalJSON() ([]byte, error) {
b1, err := json.Marshal(i.InfoProps)
if err != nil {
return nil, err
}
b2, err := json.Marshal(i.VendorExtensible)
if err != nil {
return nil, err
}
return swag.ConcatJSON(b1, b2), nil
}
示例3: MarshalJSON
// MarshalJSON converts this items object to JSON
func (r Response) MarshalJSON() ([]byte, error) {
b1, err := json.Marshal(r.ResponseProps)
if err != nil {
return nil, err
}
b2, err := json.Marshal(r.Refable)
if err != nil {
return nil, err
}
return swag.ConcatJSON(b1, b2), nil
}
示例4: MarshalJSON
// MarshalJSON marshal this to JSON
func (s SecurityScheme) MarshalJSON() ([]byte, error) {
b1, err := json.Marshal(s.SecuritySchemeProps)
if err != nil {
return nil, err
}
b2, err := json.Marshal(s.VendorExtensible)
if err != nil {
return nil, err
}
return swag.ConcatJSON(b1, b2), nil
}
示例5: MarshalJSON
// MarshalJSON converts this items object to JSON
func (r Responses) MarshalJSON() ([]byte, error) {
b1, err := json.Marshal(r.responsesProps)
if err != nil {
return nil, err
}
b2, err := json.Marshal(r.VendorExtensible)
if err != nil {
return nil, err
}
concated := swag.ConcatJSON(b1, b2)
return concated, nil
}
示例6: MarshalJSON
// MarshalJSON converts this items object to JSON
func (o Operation) MarshalJSON() ([]byte, error) {
b1, err := json.Marshal(o.OperationProps)
if err != nil {
return nil, err
}
b2, err := json.Marshal(o.VendorExtensible)
if err != nil {
return nil, err
}
concated := swag.ConcatJSON(b1, b2)
return concated, nil
}
示例7: MarshalJSON
// MarshalJSON marshal this to JSON
func (h Header) MarshalJSON() ([]byte, error) {
b1, err := json.Marshal(h.CommonValidations)
if err != nil {
return nil, err
}
b2, err := json.Marshal(h.SimpleSchema)
if err != nil {
return nil, err
}
b3, err := json.Marshal(h.HeaderProps)
if err != nil {
return nil, err
}
return swag.ConcatJSON(b1, b2, b3), nil
}
示例8: MarshalJSON
// MarshalJSON converts this items object to JSON
func (p PathItem) MarshalJSON() ([]byte, error) {
b3, err := json.Marshal(p.Refable)
if err != nil {
return nil, err
}
b4, err := json.Marshal(p.VendorExtensible)
if err != nil {
return nil, err
}
b5, err := json.Marshal(p.pathItemProps)
if err != nil {
return nil, err
}
concated := swag.ConcatJSON(b3, b4, b5)
return concated, nil
}
示例9: MarshalJSON
// MarshalJSON converts this items object to JSON
func (p Paths) MarshalJSON() ([]byte, error) {
b1, err := json.Marshal(p.VendorExtensible)
if err != nil {
return nil, err
}
pths := make(map[string]PathItem)
for k, v := range p.Paths {
if strings.HasPrefix(k, "/") {
pths[k] = v
}
}
b2, err := json.Marshal(pths)
if err != nil {
return nil, err
}
concated := swag.ConcatJSON(b1, b2)
return concated, nil
}
示例10: MarshalJSON
// MarshalJSON converts this items object to JSON
func (p Parameter) MarshalJSON() ([]byte, error) {
b1, err := json.Marshal(p.CommonValidations)
if err != nil {
return nil, err
}
b2, err := json.Marshal(p.SimpleSchema)
if err != nil {
return nil, err
}
b3, err := json.Marshal(p.Refable)
if err != nil {
return nil, err
}
b4, err := json.Marshal(p.VendorExtensible)
if err != nil {
return nil, err
}
b5, err := json.Marshal(p.ParamProps)
if err != nil {
return nil, err
}
return swag.ConcatJSON(b3, b1, b2, b4, b5), nil
}
示例11: MarshalJSON
//.........這裏部分代碼省略.........
CrmID string `json:"crmID,omitempty"`
Currency *string `json:"currency"`
Duration int32 `json:"duration,omitempty"`
DurationPeriod *string `json:"durationPeriod"`
FailedPaymentBehaviour *string `json:"failedPaymentBehaviour"`
FixedTermDefinitions []*MutableBillingEntity `json:"fixedTermDefinitions,omitempty"`
ID string `json:"id,omitempty"`
InvoiceIssueType string `json:"invoiceIssueType,omitempty"`
IssueDuration int32 `json:"issueDuration,omitempty"`
IssuePeriod string `json:"issuePeriod,omitempty"`
Metadata DynamicMetadata `json:"metadata,omitempty"`
MigrationBehaviour *string `json:"migrationBehaviour"`
Name *string `json:"name"`
PaymentTerms int64 `json:"paymentTerms,omitempty"`
ProRataMode *string `json:"proRataMode"`
Product *Product `json:"product,omitempty"`
ProductID *string `json:"productID"`
ProductType string `json:"productType,omitempty"`
PublicName string `json:"publicName,omitempty"`
Status string `json:"status,omitempty"`
TaxStatus *string `json:"taxStatus"`
Taxation []*MutableBillingEntity `json:"taxation,omitempty"`
Trial int32 `json:"trial,omitempty"`
TrialPeriod string `json:"trialPeriod,omitempty"`
Updated strfmt.DateTime `json:"updated,omitempty"`
ValidFrom strfmt.DateTime `json:"validFrom,omitempty"`
ValidTill strfmt.DateTime `json:"validTill,omitempty"`
}{
AggregatingComponents: m.AggregatingComponents,
ChangedBy: m.ChangedBy,
CreateZeroValuedInvoices: m.CreateZeroValuedInvoices,
Created: m.Created,
CrmID: m.CrmID,
Currency: m.Currency,
Duration: m.Duration,
DurationPeriod: m.DurationPeriod,
FailedPaymentBehaviour: m.FailedPaymentBehaviour,
FixedTermDefinitions: m.FixedTermDefinitions,
ID: m.ID,
InvoiceIssueType: m.InvoiceIssueType,
IssueDuration: m.IssueDuration,
IssuePeriod: m.IssuePeriod,
Metadata: m.Metadata,
MigrationBehaviour: m.MigrationBehaviour,
Name: m.Name,
PaymentTerms: m.PaymentTerms,
ProRataMode: m.ProRataMode,
Product: m.Product,
ProductID: m.ProductID,
ProductType: m.ProductType,
PublicName: m.PublicName,
Status: m.Status,
TaxStatus: m.TaxStatus,
Taxation: m.Taxation,
Trial: m.Trial,
TrialPeriod: m.TrialPeriod,
Updated: m.Updated,
ValidFrom: m.ValidFrom,
ValidTill: m.ValidTill,
})
if err != nil {
return nil, err
}
b2, err = json.Marshal(struct {
PricingComponents []PricingComponent `json:"pricingComponents"`
}{
PricingComponents: m.PricingComponents,
})
if err != nil {
return nil, err
}
return swag.ConcatJSON(b1, b2), nil
}