UI5 / UI5/openui5

Documentation: Several types in namespace `sap.ui.model.type` are missing supported formatting options

Open
#3,642 4 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

documentation enhancement in progress
Dominant language
JavaScript
Stars
3.3k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

OpenUI5 version: 1.108.0

For the typescript type definitions, it would be very useful if the constructor documentation for all Types in the sap.ui.model.type namespace would contain all supported formatting options.

As an example, the documentation for type sap.ui.model.type.Float states that all supported formatting options of NumberFormat are accepted. Two of those options (out of many) are listed explicitly:

https://github.com/SAP/openui5/blob/ed3ff6eee9058a6929b5c82cc3552af7da0ccb43/src/sap.ui.core/src/sap/ui/model/type/Float.js#L30-L35

This is pretty much the same for all type classes in the package (besides Boolean and String, which don't accept formatting options). Could you add the missing formatting options to the documentation? This would give type safety to developers and also allows to get rid of casts to handover formatting options to the different constructors, which are not explicitly documented.

Outside the sap.ui.model.type namespace, I saw the method NumberFormat.getInstance(..) where the formatting options are also not listed.

Thanks for considering this!

Regards,
Florian

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.