mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-10-13 16:03:43 +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:
|
||||
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/**'
|
||||
- 'samples/openapi3/client/petstore/go-petstore-withXml/**'
|
||||
- samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/**
|
||||
pull_request:
|
||||
paths:
|
||||
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/**'
|
||||
- 'samples/openapi3/client/petstore/go-petstore-withXml/**'
|
||||
- samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/**
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@ -20,6 +22,7 @@ jobs:
|
||||
sample:
|
||||
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/'
|
||||
- 'samples/openapi3/client/petstore/go-petstore-withXml/'
|
||||
- samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-go@v6
|
||||
|
@ -6,4 +6,4 @@ additionalProperties:
|
||||
enumClassPrefix: "true"
|
||||
packageName: petstore
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
withXml: false
|
||||
withXml: true
|
||||
|
@ -19,8 +19,8 @@ var _ MappedNullable = &Category{}
|
||||
|
||||
// Category A category for a pet
|
||||
type Category struct {
|
||||
Id *int64 `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty" validate:"regexp=^[a-zA-Z0-9]+[a-zA-Z0-9\\\\.\\\\-_]*[a-zA-Z0-9]+$"`
|
||||
Id *int64 `json:"id,omitempty" xml:"id"`
|
||||
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{}
|
||||
}
|
||||
|
||||
|
@ -20,14 +20,14 @@ var _ MappedNullable = &Pet{}
|
||||
|
||||
// Pet A pet for sale in the pet store
|
||||
type Pet struct {
|
||||
Id *int64 `json:"id,omitempty"`
|
||||
Category *Category `json:"category,omitempty"`
|
||||
Name string `json:"name"`
|
||||
PhotoUrls []string `json:"photoUrls"`
|
||||
Tags []Tag `json:"tags,omitempty"`
|
||||
Id *int64 `json:"id,omitempty" xml:"id"`
|
||||
Category *Category `json:"category,omitempty" xml:"category"`
|
||||
Name string `json:"name" xml:"name"`
|
||||
PhotoUrls []string `json:"photoUrls" xml:"photoUrls>photoUrl"`
|
||||
Tags []Tag `json:"tags,omitempty" xml:"tags>tag"`
|
||||
// pet status in the store
|
||||
// Deprecated
|
||||
Status *string `json:"status,omitempty"`
|
||||
Status *string `json:"status,omitempty" xml:"status"`
|
||||
AdditionalProperties map[string]interface{}
|
||||
}
|
||||
|
||||
|
@ -19,8 +19,8 @@ var _ MappedNullable = &Tag{}
|
||||
|
||||
// Tag A tag for a pet
|
||||
type Tag struct {
|
||||
Id *int64 `json:"id,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Id *int64 `json:"id,omitempty" xml:"id"`
|
||||
Name *string `json:"name,omitempty" xml:"name"`
|
||||
AdditionalProperties map[string]interface{}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user