Jonas Reichert f45523dd1a
[swift5] fix modelNamePrefix and -suffix for reserved types (#14768)
* only add suffix or prefix if type is not a primitive or from dependency

* add tests

* add sample

* add second API with prefix and suffix

* add primitives

* add missing pom

* add missing shell script

* fix cycle dependency

* generate samples
2023-03-13 09:42:24 +00:00

2.3 KiB

PetsAPI

All URIs are relative to http://localhost

Method HTTP request Description
petsGet GET /pets
showPetById GET /pets/{petId} Info for a specific pet

petsGet

    open class func petsGet(completion: @escaping (_ data: PrefixPetSuffix?, _ error: Error?) -> Void)

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import PetstoreClient


PetsAPI.petsGet() { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

This endpoint does not need any parameter.

Return type

PrefixPetSuffix

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

showPetById

    open class func showPetById(petId: String, completion: @escaping (_ data: AnyCodable?, _ error: Error?) -> Void)

Info for a specific pet

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import PetstoreClient

let petId = "petId_example" // String | The id of the pet to retrieve

// Info for a specific pet
PetsAPI.showPetById(petId: petId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
petId String The id of the pet to retrieve

Return type

AnyCodable

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]