Skip to content

Incorrect Maintenance field validation #206

@valeriocomo

Description

@valeriocomo

Description

The validator try to validate the subfield contacts or contractors when should not be present.

Payload example

maintenance:
  type: "community"
  
  # Should NOT validate contractors
  contractors:
    - name: "Fornitore Privato SPA"
      website: "https://developers.italia.it"
      #until: "2019-01-01"

  contacts:
    - name: Francesco Rossi

If this payload would be submitted, the validator will fail because a contractor item is not valid (until field is mandatory and must be defined). But, It must not be validated because field type value isn't set to contract.
The same behaviour applies in the case where type is set to contract and there are occurrences of contacts.

Step to reproduce

Validate a publiccode.yml with a payload formed like the one described above.

Expected behaviour

Should return an error because there are occurrences of contractors/contacts when the value of type isn't set accordingly, IMHO.
@bfabio @tensor5 your opinions are welcome.

Actual behaviour

It returns an error because an occurrence of contractors/contacts is not valid (as stated in the description).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions