Skip to content

Conversation

@tensor5
Copy link
Member

@tensor5 tensor5 commented Oct 30, 2025

Following italia/publiccode-crawler#468, the publiccode data returned by the API use the key IT rather than it for the country specific part.

Description

This PR tackles:

  • ...
  • ...
  • ...

In particular, the ...

Checklist

  • I followed the indications in CONTRIBUTING.md
  • The documentation related to the proposed change has been updated accordingly (also comments in code).
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?
  • Ready for review! 🚀

Fixes

Fixes #

@tensor5
Copy link
Member Author

tensor5 commented Oct 30, 2025

@bfabio

Following italia/publiccode-crawler#468, the publiccode data returned by
the API use the key `IT` rather than `it` for the country specific part.
@bfabio
Copy link
Member

bfabio commented Oct 30, 2025

@tensor5 yes, v5 is breaking. There is some retrocompatibility, but it's in the library API in the sense that PubliccodeV0.It (not the lowercase) is preserved.

Unfortunately it's tricky for the serialization because we'd serialize a publiccode.yml with deprecated fields and I didn't feel like it. And equally unfortunately Jekyll/Liquid isn't typed and uses the raw serialization instead of types so we might see breakages like this one. It'll be the same when publiccode.yml v1 is released and v1 files start to appear, so my advice is following publiccode.yml development and its tooling. Eventually the site should handle different publiccode.yml versions.

Anyway, you might want to use publiccode.organisation.uri instead of the deprecated it.riuso.codiceIPA and organisation.name instead of legal.repoOwner. They are guaranteed to be there when the deprecated keys are present.

Just note that for Italian PAs they will be URNs with this format: `"urn:x-italian-pa:CODICE_IPA"
(https://github.com/italia/publiccode-parser-go/blob/d5b3691352785c0ce3eaa898ebf59636bf87c029/parser.go#L319-L320)

@bfabio
Copy link
Member

bfabio commented Oct 30, 2025

Also, take a look at italia/publiccode-editor#526 which quickly summarizes changes in v0.5. Surely the categories changes require some adapting as well, same goes for some of the other changes.

@tensor5 tensor5 merged commit ed3fabc into main Oct 30, 2025
2 of 3 checks passed
@tensor5 tensor5 deleted the fix/look-for-it branch October 30, 2025 14:59
{% if withimages == true %}

{% if item.publiccode.it.riuso.codiceIPA != nil %}
{% if item.publiccode.IT.riuso.codiceIPA != nil %}
Copy link
Member

Choose a reason for hiding this comment

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

maybe we can consider both cases ?
const prop = item.publiccode.['it'] || item.publiccode.['IT']; if(prop?.riuso.codiceIPA){}

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure. We definitely need to make it more resilient. I had to merge it quickly in order to solve our problem by today.

@tensor5
Copy link
Member Author

tensor5 commented Oct 30, 2025

Basically, we are in the situation where we have in our database software with the same version of publiccode ("0.4"), some of which use the key it and some use IT.

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.

4 participants