-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for IntOrString in Java #30
Add support for IntOrString in Java #30
Conversation
openapi/preprocess_spec.py
Outdated
print("Making model `%s` inline as %s..." % (k, v["type"])) | ||
find_replace_ref_recursive(spec, "#/definitions/" + k, v) | ||
to_remove_models.append(k) | ||
if k not in excluded_primitives: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think I'd prefer
if k in excluded_primitives:
continue
...
openapi/preprocess_spec.py
Outdated
|
||
for k in to_remove_models: | ||
del spec['definitions'][k] | ||
|
||
def write_json(filename, object): | ||
with open(filename, 'w') as out: | ||
json.dump(object, out, sort_keys=False, indent=2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I don't really love this line breaking, can you get it all on one line?
openapi/preprocess_spec.py
Outdated
if len(sys.argv) != 3: | ||
print("Usage:\n\n\tpython preprocess_spec.py kuberneres_branch " \ | ||
if len(sys.argv) != 4: | ||
print("Usage:\n\n\tpython preprocess_spec.py client_language kuberneres_branch " \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may as well fix the 'kuberneres_branch' typo while you're in here...
This basically LGTM, some small nits. @mbohlool any thoughts? |
For some reason in |
/lgtm |
Allows certain languages to opt out of preprocessing away primitive types. This is done in order to allow the spec to be passed to Java containing the
intstr.IntOrString
type. This allows us to then rebind the type mapping forintstr.IntOrString
to a custom class (see PR injava
client).