Should PyWPS automatically set minOccurs=0 when literal data default is provided?
- Dominant language
- Python
- Stars
- 186
- Forks
- 117
- Avg merge
- 11d 20h
- Merged PRs (30d)
- 1
Description
# Description
Field `min_occurs=1` is the default of inputs. When `default` parameter is provided to define a default literal value, that default `1` occurrence loses its meaning. I would imagine most people expect that adding this `default` parameter will make their process pick that value if it was omitted, but this will never happen due to `min_occurs=1` check at execution time. The process description also displays ``minOccurs=1` and `defaultValue` simultaneously, which makes the *default behaviour* hard to understand.
I am questioning whether PyWPS should be smart about it and automatically adjust the value to `0` when `default` is provided, since it doesn't make sense to have that default if it cannot be resolved *by default* when omitting the input value.
Although the fix is relatively simple to manually adjust any process I/O incorrectly defined, I find this is a quite common and recurring issue. See for example [additional information](#additional-information) which is just a list of cases I found within a week, over many WPS process implementations.
# Environment
- operating system: ubuntu 20.04
- Python version: 3.8
- PyWPS version: latest
- source/distribution
- [ ] git clone
- [ ] Debian
- [x] PyPI
- [ ] zip/tar.gz
- [ ] other (please specify):
- web server
- [ ] Apache/mod_wsgi
- [ ] CGI
- [ ] other (please specify):
# Additional Information
Following related issues/PR where similar problem was noticed:
- https://github.com/bird-house/flyingpigeon/issues/342
- https://github.com/bird-house/finch/pull/199
- https://github.com/crim-ca/weaver/issues/17
- https://github.com/crim-ca/weaver/pull/326
Contributor guide
Assessment
This issue has not been assessed yet.