Comments (2)
It's one of those things that made sense at the time, and in a way still does considering the way data entry is done in the UI. It's not as ergonomic in the API, as you have discovered.
The gist of things is this:
If you supply a package ID (and only a package ID, besides any required usage data), that will get attached to your project, and that's that.
If you supply package information (and no package ID), then a new package will be created. In the UI, these are grouped by package name and version. In a way those are keys for tracking a package. It's OK to have multiple rows with the same package name and version, they represent different revisions of a package. In the UI, if a newer revision is present than what's on your project (determined by the largest package ID), it'll offer to "update" your data. This ends up making more sense at scale with lots of people entering in data for different projects, but a shared package database.
If you supply both a package ID and package information, one of two things will happen:
A. If all information supplied is exactly the same as what's stored in the database, the package will be attached with the same ID. No new package will be created. Or,
B. If any details differ, the API will instead create a new revision of that package and return the new package ID, which will be attached to your project. It's not super smart about this -- if an even older revision was the same, it doesn't really know that.
When using the API, I recommend that you only supply a package ID (+usage data if/as required) if you want to attach an existing package or just package information if you know you want something new.
Nowadays, there are many fantastic projects that catalogue license data and package information. ClearlyDefined is one of them, and would things be re-done we'd probably key off of identifiers like CD's coordinates system. But, legacy. :)
The API docs could certainly be improved here. I'll certainly take pull requests for that, but will also keep this open as a backlog item to make that better.
from oss-attribution-builder.
from oss-attribution-builder.
Related Issues (20)
- Figure out Gulp/build situation HOT 1
- Update npm dependencies HOT 1
- Tags should be able to present additional info to the UI HOT 1
- Tags should be able to ask for additional information in how a package is used HOT 1
- Project cloning
- Marking components as validated/confirmed/curated HOT 3
- API for adding components HOT 3
- Auto-discover license from URL HOT 1
- Auto-detect license text HOT 1
- Change package version without needing to re-enter package information
- No UI for editing project ACLs HOT 1
- Programmatic access HOT 1
- Issues with large projects HOT 1
- Trim whitespace on package names/versions HOT 1
- attribution builder accessible through localhost:8000 not 2424 HOT 3
- API: creating a new project returns "You cannot remove yourself as an owner." HOT 4
- TAGS: transformCopyright() not working as expected with 'notice' HOT 4
- Archiving projects HOT 1
- Closing down oss-attribution-builder
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oss-attribution-builder.