publiccode-editor icon indicating copy to clipboard operation
publiccode-editor copied to clipboard

Fetch api values

Open giosce opened this issue 4 years ago • 5 comments

I'm working on adopting public code by a large US organization. We will need more changes, this is a basic one. My ideal approach is to have as much common code as possible and have country or organization customizations as much as possible in config files.

This change allows to populate the "Scope" dropdown from a different source, in this case from our Taxonomy API. It is backward compatible, if someone doesn't provide a fetch URL the app will continue to work like it is now.

Happy to review/discuss this and other change ideas.

giosce avatar Feb 10 '22 00:02 giosce

@giosce is attempting to deploy a commit to the dip-trasformazione-digitale Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Feb 10 '22 00:02 vercel[bot]

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/dip-trasformazione-digitale/publiccode-editor/31z4i9acjkRWnMwSyhE1zR4AxpGN
✅ Preview: https://publiccode-editor-git-fork-g-fa83f3-dip-trasformazione-digitale.vercel.app

vercel[bot] avatar Feb 16 '22 16:02 vercel[bot]

@giosce I'm not convinced by this one, as the editor would generate an invalid publiccode.yml.

One solution could be using a US centric key in a country specific section (and have the editor show the country specific sections based on which countries are enabled in the config file).

Alternatively, we can discuss to change the scopes in the Standard for everyone, over at the [Standard's Discussions],(https://github.com/publiccodeyml/publiccode.yml/discussions) and see if it gets traction.

bfabio avatar Feb 16 '22 16:02 bfabio

Thanks Fabio for your feedback. I didn't understand how the publiccode.yml is validated (by a software?). I appreciate that Digital PA has done and is doing a lot of work for publiccode. But it seems really strange to me if a valid publiccode.yml can't have different values. The schema validation should, in my opinion, check that mandatory fields and their format are provided, actual values can be dependent on the context. I'll take a look at the "Standard", thanks!

giosce avatar Feb 21 '22 21:02 giosce

@giosce you're welcome!

There is a reference validator at https://github.com/italia/publiccode-parser-go which checks for conformance to the publiccode.yml Standard (https://yml.publiccode.tools/).

As of now the Standard defines not only the keys in the YAML, but also the value they can hold, in some cases.

bfabio avatar Feb 23 '22 17:02 bfabio