mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-10-14 16:33:56 +00:00
Improve Go client tests (#21919)
* test withXml option * fix path * update go code (withXml: true) * test one more go client
This commit is contained in:
parent
6e089f5f03
commit
bdfbb32cdd
3
.github/workflows/samples-go-client.yaml
vendored
3
.github/workflows/samples-go-client.yaml
vendored
@ -5,10 +5,12 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/**'
|
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/**'
|
||||||
- 'samples/openapi3/client/petstore/go-petstore-withXml/**'
|
- 'samples/openapi3/client/petstore/go-petstore-withXml/**'
|
||||||
|
- samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/**
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/**'
|
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/**'
|
||||||
- 'samples/openapi3/client/petstore/go-petstore-withXml/**'
|
- 'samples/openapi3/client/petstore/go-petstore-withXml/**'
|
||||||
|
- samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/**
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -20,6 +22,7 @@ jobs:
|
|||||||
sample:
|
sample:
|
||||||
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/'
|
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/'
|
||||||
- 'samples/openapi3/client/petstore/go-petstore-withXml/'
|
- 'samples/openapi3/client/petstore/go-petstore-withXml/'
|
||||||
|
- samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-go@v6
|
- uses: actions/setup-go@v6
|
||||||
|
@ -6,4 +6,4 @@ additionalProperties:
|
|||||||
enumClassPrefix: "true"
|
enumClassPrefix: "true"
|
||||||
packageName: petstore
|
packageName: petstore
|
||||||
disallowAdditionalPropertiesIfNotPresent: false
|
disallowAdditionalPropertiesIfNotPresent: false
|
||||||
withXml: false
|
withXml: true
|
||||||
|
@ -19,8 +19,8 @@ var _ MappedNullable = &Category{}
|
|||||||
|
|
||||||
// Category A category for a pet
|
// Category A category for a pet
|
||||||
type Category struct {
|
type Category struct {
|
||||||
Id *int64 `json:"id,omitempty"`
|
Id *int64 `json:"id,omitempty" xml:"id"`
|
||||||
Name *string `json:"name,omitempty" validate:"regexp=^[a-zA-Z0-9]+[a-zA-Z0-9\\\\.\\\\-_]*[a-zA-Z0-9]+$"`
|
Name *string `json:"name,omitempty" xml:"name" validate:"regexp=^[a-zA-Z0-9]+[a-zA-Z0-9\\\\.\\\\-_]*[a-zA-Z0-9]+$"`
|
||||||
AdditionalProperties map[string]interface{}
|
AdditionalProperties map[string]interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,14 +20,14 @@ var _ MappedNullable = &Pet{}
|
|||||||
|
|
||||||
// Pet A pet for sale in the pet store
|
// Pet A pet for sale in the pet store
|
||||||
type Pet struct {
|
type Pet struct {
|
||||||
Id *int64 `json:"id,omitempty"`
|
Id *int64 `json:"id,omitempty" xml:"id"`
|
||||||
Category *Category `json:"category,omitempty"`
|
Category *Category `json:"category,omitempty" xml:"category"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name" xml:"name"`
|
||||||
PhotoUrls []string `json:"photoUrls"`
|
PhotoUrls []string `json:"photoUrls" xml:"photoUrls>photoUrl"`
|
||||||
Tags []Tag `json:"tags,omitempty"`
|
Tags []Tag `json:"tags,omitempty" xml:"tags>tag"`
|
||||||
// pet status in the store
|
// pet status in the store
|
||||||
// Deprecated
|
// Deprecated
|
||||||
Status *string `json:"status,omitempty"`
|
Status *string `json:"status,omitempty" xml:"status"`
|
||||||
AdditionalProperties map[string]interface{}
|
AdditionalProperties map[string]interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,8 +19,8 @@ var _ MappedNullable = &Tag{}
|
|||||||
|
|
||||||
// Tag A tag for a pet
|
// Tag A tag for a pet
|
||||||
type Tag struct {
|
type Tag struct {
|
||||||
Id *int64 `json:"id,omitempty"`
|
Id *int64 `json:"id,omitempty" xml:"id"`
|
||||||
Name *string `json:"name,omitempty"`
|
Name *string `json:"name,omitempty" xml:"name"`
|
||||||
AdditionalProperties map[string]interface{}
|
AdditionalProperties map[string]interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user