Desired Yaml:
path:
"/":
get:
summary: Root
operationId: root__get
I have a python dictionary like so:
path_dict = {
path:{
"/": {
get: {
summary: Root
operationId: root__get
}
}
}
}
When I do yaml.dump(path_dict), I get this (the double quotes disappear):
path:
/:
get:
summary: Root
operationId: root__get
But when I wrap my path dict "/" in another set of quotes, or using \"
like so:
path_dict = {
path:{
'"/"': {
get: {
summary: Root
operationId: root__get
}
}
}
}
My yaml file becomes:
path:
'"/"':
get:
summary: Root
operationId: root__get
Is there a neat way to preserve the "
just for the "/"
key but not for the rest of the keys? I need my yaml file to be in this specific format to satisfy Swagger2.0 specs.