Improve struct and field comments and incorporate into json schema (#4252)

* improve struct and field comments and incorporate into json schema

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* address review feedback

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

---------

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
Alex Goodman
2025-10-03 17:01:56 +00:00
committed by GitHub
parent b96d3d20af
commit a77d24e379
57 changed files with 4241 additions and 1676 deletions
+79 -25
View File
@@ -5,35 +5,82 @@ type PhpComposerInstalledEntry PhpComposerLockEntry
// PhpComposerLockEntry represents a single package entry found from a composer.lock file.
type PhpComposerLockEntry struct {
Name string `json:"name"`
Version string `json:"version"`
Source PhpComposerExternalReference `json:"source"`
Dist PhpComposerExternalReference `json:"dist"`
Require map[string]string `json:"require,omitempty"`
Provide map[string]string `json:"provide,omitempty"`
RequireDev map[string]string `json:"require-dev,omitempty"`
Suggest map[string]string `json:"suggest,omitempty"`
License []string `json:"license,omitempty"`
Type string `json:"type,omitempty"`
NotificationURL string `json:"notification-url,omitempty"`
Bin []string `json:"bin,omitempty"`
Authors []PhpComposerAuthors `json:"authors,omitempty"`
Description string `json:"description,omitempty"`
Homepage string `json:"homepage,omitempty"`
Keywords []string `json:"keywords,omitempty"`
Time string `json:"time,omitempty"`
// Name is package name in vendor/package format (e.g. symfony/console)
Name string `json:"name"`
// Version is the package version
Version string `json:"version"`
// Source is the source repository information for development (typically git repo, used when passing --prefer-source). Originates from source code repository.
Source PhpComposerExternalReference `json:"source"`
// Dist is distribution archive information for production (typically zip/tar, default install method). Packaged version of released code.
Dist PhpComposerExternalReference `json:"dist"`
// Require is runtime dependencies with version constraints (package will not install unless these requirements can be met)
Require map[string]string `json:"require,omitempty"`
// Provide is virtual packages/functionality provided by this package (allows other packages to depend on capabilities)
Provide map[string]string `json:"provide,omitempty"`
// RequireDev is development-only dependencies (not installed in production, only when developing this package or running tests)
RequireDev map[string]string `json:"require-dev,omitempty"`
// Suggest is optional but recommended dependencies (suggestions for packages that would extend functionality)
Suggest map[string]string `json:"suggest,omitempty"`
// License is the list of license identifiers (SPDX format)
License []string `json:"license,omitempty"`
// Type is package type indicating purpose (library=reusable code, project=application, metapackage=aggregates dependencies, etc.)
Type string `json:"type,omitempty"`
// NotificationURL is the URL to notify when package is installed (for tracking/statistics)
NotificationURL string `json:"notification-url,omitempty"`
// Bin is the list of binary/executable files that should be added to PATH
Bin []string `json:"bin,omitempty"`
// Authors are the list of package authors with name/email/homepage
Authors []PhpComposerAuthors `json:"authors,omitempty"`
// Description is a human-readable package description
Description string `json:"description,omitempty"`
// Homepage is project homepage URL
Homepage string `json:"homepage,omitempty"`
// Keywords are the list of keywords for package discovery/search
Keywords []string `json:"keywords,omitempty"`
// Time is timestamp when this package version was released
Time string `json:"time,omitempty"`
}
// PhpComposerExternalReference represents source or distribution information for a PHP package, indicating where the package code is retrieved from.
type PhpComposerExternalReference struct {
Type string `json:"type"`
URL string `json:"url"`
// Type is reference type (git for source VCS, zip/tar for dist archives)
Type string `json:"type"`
// URL is the URL to the resource (git repository URL or archive download URL)
URL string `json:"url"`
// Reference is git commit hash or version tag for source, or archive version for dist
Reference string `json:"reference"`
Shasum string `json:"shasum,omitempty"`
// Shasum is SHA hash of the archive file for integrity verification (dist only)
Shasum string `json:"shasum,omitempty"`
}
// PhpComposerAuthors represents author information for a PHP Composer package from the authors field in composer.json.
type PhpComposerAuthors struct {
Name string `json:"name"`
Email string `json:"email,omitempty"`
// Name is author's full name
Name string `json:"name"`
// Email is author's email address
Email string `json:"email,omitempty"`
// Homepage is author's personal or company website
Homepage string `json:"homepage,omitempty"`
}
@@ -43,8 +90,15 @@ type PhpPeclEntry PhpPearEntry
// PhpPearEntry represents a single package entry found within php pear metadata files.
type PhpPearEntry struct {
Name string `json:"name"`
Channel string `json:"channel,omitempty"`
Version string `json:"version"`
// Name is the package name
Name string `json:"name"`
// Channel is PEAR channel this package is from
Channel string `json:"channel,omitempty"`
// Version is the package version
Version string `json:"version"`
// License is the list of applicable licenses
License []string `json:"license,omitempty"`
}