Skip to content

Strip empty component sections from doc#421

Merged
lafrech merged 2 commits intodevfrom
strip_empty_subsections_from_docs
Apr 7, 2019
Merged

Strip empty component sections from doc#421
lafrech merged 2 commits intodevfrom
strip_empty_subsections_from_docs

Conversation

@lafrech
Copy link
Copy Markdown
Member

@lafrech lafrech commented Apr 2, 2019

This PR removes empty component subsections (parameters, responses, etc.) from the docs.

I'm tempted not to consider that a breaking change.

Copy link
Copy Markdown
Member

@sloria sloria left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a little nit. Go ahead and address and merge, or we can address it later.

I wouldn't consider this a breaking change because it's not an API change. This warrants a minor version bump.

Comment thread tests/test_ext_marshmallow.py Outdated
plugins=(MarshmallowPlugin(schema_name_resolver=resolver),),
)
assert {} == get_schemas(spec)
assert get_schemas(spec) is None
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: It might be good for the get_ functions to default to a sentinel value, like marshmallow.missing.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather avoid missing as this could pass a wrong change leaking the missing object into the generated spec.

I could create a dedicated MISSING_FROM_SPEC singleton.

Overall, it looks just as simple to catch KeyError. Also, when using OAS3, KeyError covers the case where the whole components section is missing. See new commit.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me.

@sloria
Copy link
Copy Markdown
Member

sloria commented Apr 7, 2019

Is there a corresponding issue for this PR? I thought I remember seeing one but I can't find it.

@lafrech
Copy link
Copy Markdown
Member Author

lafrech commented Apr 7, 2019

Just a comment: #408 (comment).

@lafrech lafrech merged commit 14b4762 into dev Apr 7, 2019
@lafrech lafrech deleted the strip_empty_subsections_from_docs branch April 7, 2019 16:50
@lafrech
Copy link
Copy Markdown
Member Author

lafrech commented Apr 7, 2019

Merged. Thanks for reviewing.

@sloria
Copy link
Copy Markdown
Member

sloria commented Apr 7, 2019

No prob. Will you take care of the release, or shall I do that?

@lafrech
Copy link
Copy Markdown
Member Author

lafrech commented Apr 7, 2019

I can. Never did. Do I just need to push a tag?

@sloria
Copy link
Copy Markdown
Member

sloria commented Apr 7, 2019

Yeah, pretty much. The process is the same as marshmallow's: https://github.com/marshmallow-code/marshmallow/blob/dev/RELEASING.md

@lafrech
Copy link
Copy Markdown
Member Author

lafrech commented Apr 7, 2019

Thanks. I never noticed this file.

@lafrech
Copy link
Copy Markdown
Member Author

lafrech commented Apr 8, 2019

Done.

I added release notes on Tidelift for 1.1.0 and 1.1.1. 1.1.2 and 1.2.0 are not there yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants