Closed StasanTelnov closed 5 years ago
Hi @StasanTelnov. The way urls are defined in Swagger is with a string and a uri
format: https://swagger.io/specification/#dataTypes
definitions:
SiteLink:
type: object
properties:
title:
type: string
link:
type: string
format: uri
I hope that helps
Thanks. I see Data Types, but "uri", dont declared in OAS. I trying
link:
type: string
format: url
but received
var link: String?
in .swift file and I decided that URL`s is not supported "out of the box".
It mentions the uri
format is an unofficial standard. That’s what SwagGen and other generators use as a URL.
Try uri instead of url
Hello. I write custom template with using Moya for request and responces and ObjectMapper for mapping. ObjectMapper have very cool mapping of non standart types.
For example, ObjectMapper swift model:
I try write this model in my YAML file:
But in result I see
But I dont found "UNKNOWN_ANY" string in files in this repository and in swagger-codegen repository. I found, that file SwagGen/Sources/SwagGenKit/SwiftFormatter.swift generate type and moving result to "properties[N].optionalType" variable, which I can see in .stencil file.
I dont undestand, I can detect in my .stencil file, that raw type is "url" and apply some other template for this property type? Or I have only way for handling non-standart property type - fork SwagGen and modify SwiftFormatter.swift?
Thanks for answer