API Documentation
Have you ever used http://swagger.io/? Or do you know any other alternatives?
Since we’re writing APIs thought it might make a good tutorial on making documentation for it.
How would I retrieve the acronym using the ‘short’ field (i.e. not by its id) ?
I assume I have to create a route e.g. acronyms/short/WTF, but how to get the acronym from the db ?
Hi! I encountered this Could not initialize Card, skipping: unableToConvert(nil, “String”) issue and after many experiments, I think I found a solution (or at least a workaround).
For some context, I’m building a Card game and using PostgreSQL. The Card model had the following property:
var cardType: String
In the init(node: Node, in context: Context) method, there I see this error if the extract keys are not lowercase.
cardType = try node.extract(“cardtype”)
A lot of research to get to this point, but hopefully is solves your problem. While I prefer camel case, the database drivers providers don’t quite play nice here so I have opted for card_type and similar property naming even if it isn’t very swifty.
Solved my problem! I was trying to use camel case in my node.extract() keys as well. When I look at the table in Postgres all the field names are lower case. Thank you so much for posting this!