mansenfranzen / autodoc_pydantic

Seamlessly integrate pydantic models in your Sphinx documentation.
MIT License
159 stars 27 forks source link

Allow `autodoc_pydantic_field_signature_prefix` to be empty #188

Closed azmeuk closed 7 months ago

azmeuk commented 11 months ago

Hi. Currently autodoc_pydantic_field_signature_prefix cannot be None (else it raises an exception while documentation is built) or an empty string (else the default attribute value is used). I would love to be able to disable prefixes with autodoc_pydantic_field_signature_prefix = None. What do you think?

mansenfranzen commented 11 months ago

Hi @azmeuk,

thanks for providing the feature request. It sounds reasonable to me. I will put it on the roadmap for the next feature release.

mansenfranzen commented 7 months ago

@azmeuk Empty strings will now translate to empty prefixes via #285. Actually, this behavior is more clear and intuitive than the previous behavior of adding some default prefix that was not even documented anywhere. By the way, this also simplified the code base :-).

It would be great if you could test the changed behavior. To do so, please install the current dev release in your doc-building-environment via pip install git+https://github.com/mansenfranzen/autodoc_pydantic.git@v2.2.0-a.2 and rebuild your docs.

Please reopen if any issues persist.

mansenfranzen commented 7 months ago

@all-contributors please add @azmeuk for bug

allcontributors[bot] commented 7 months ago

@mansenfranzen

I've put up a pull request to add @azmeuk! :tada:

azmeuk commented 6 months ago

@mansenfranzen Sorry for the long silence. I just tested and it renders exactly as I wished :ok_hand: Thank you very much!