GetShopTV / swagger2

Swagger 2.0 data model.
http://hackage.haskell.org/package/swagger2
BSD 3-Clause "New" or "Revised" License
74 stars 59 forks source link

Escape URI #204

Open ilyakooo0 opened 4 years ago

ilyakooo0 commented 4 years ago

Escape URIs to be RFC3986-compliant.

For example, it is quite common to have single quotes at the end of Haskell record names.

fisx commented 4 years ago

Thanks for pointing this out.

I would go about this by replacing the internal URL newtype with uri-bytestring, then it's just a matter of using the library interface correctly. (I don't know if there is any better uri library around.)

Would you be interested in putting together a PR? That would be great! :)

ilyakooo0 commented 4 years ago

Is there a reason why you think using uri-bytestring is better than using libraries like modern-uri or network-uri?

EDIT: Read the comment again. Will probably use modern-uri

fisx commented 4 years ago

Is there a reason why you think using uri-bytestring is better than using libraries like modern-uri or network-uri?

i don't think that, and no reason. :-)

@fizruk any opinions? anybody else?

ilyakooo0 commented 4 years ago

I'm pretty sure it's not as simple as just replacing the URL with URI, since the structure schemas are stored and encoded as just a InsOrdHashMap Text Scheme.

ilyakooo0 commented 4 years ago

I'm having trouble finding where the names from NamedSchema are converted into a URL

fisx commented 4 years ago

I haven't checked that, and I won't have time this week to do so. It's conceivable that more refactoring and repair work will be required for this.