Add OpenAPI specification for Link-Not-Merge Policy APIs
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
- Introduced a new OpenAPI YAML file for the StellaOps Concelier service. - Defined endpoints for listing linksets, retrieving linksets by advisory ID, and searching linksets. - Included detailed parameter specifications and response schemas for each endpoint. - Established components for reusable parameters and schemas, enhancing API documentation clarity.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
@@ -9,16 +8,30 @@ namespace StellaOps.Concelier.WebService.Contracts;
|
||||
public sealed record LnmLinksetResponse(
|
||||
[property: JsonPropertyName("advisoryId")] string AdvisoryId,
|
||||
[property: JsonPropertyName("source")] string Source,
|
||||
[property: JsonPropertyName("observations")] IReadOnlyList<string> Observations,
|
||||
[property: JsonPropertyName("normalized")] LnmLinksetNormalized? Normalized,
|
||||
[property: JsonPropertyName("conflicts")] IReadOnlyList<LnmLinksetConflict>? Conflicts,
|
||||
[property: JsonPropertyName("purl")] IReadOnlyList<string> Purl,
|
||||
[property: JsonPropertyName("cpe")] IReadOnlyList<string> Cpe,
|
||||
[property: JsonPropertyName("summary")] string? Summary,
|
||||
[property: JsonPropertyName("publishedAt")] DateTimeOffset? PublishedAt,
|
||||
[property: JsonPropertyName("modifiedAt")] DateTimeOffset? ModifiedAt,
|
||||
[property: JsonPropertyName("severity")] string? Severity,
|
||||
[property: JsonPropertyName("status")] string? Status,
|
||||
[property: JsonPropertyName("provenance")] LnmLinksetProvenance? Provenance,
|
||||
[property: JsonPropertyName("createdAt")] DateTimeOffset CreatedAt,
|
||||
[property: JsonPropertyName("builtByJobId")] string? BuiltByJobId,
|
||||
[property: JsonPropertyName("cached")] bool Cached);
|
||||
[property: JsonPropertyName("conflicts")] IReadOnlyList<LnmLinksetConflict> Conflicts,
|
||||
[property: JsonPropertyName("timeline")] IReadOnlyList<LnmLinksetTimeline> Timeline,
|
||||
[property: JsonPropertyName("normalized")] LnmLinksetNormalized? Normalized,
|
||||
[property: JsonPropertyName("cached")] bool Cached,
|
||||
[property: JsonPropertyName("remarks")] IReadOnlyList<string> Remarks,
|
||||
[property: JsonPropertyName("observations")] IReadOnlyList<string> Observations);
|
||||
|
||||
public sealed record LnmLinksetPage(
|
||||
[property: JsonPropertyName("items")] IReadOnlyList<LnmLinksetResponse> Items,
|
||||
[property: JsonPropertyName("page")] int Page,
|
||||
[property: JsonPropertyName("pageSize")] int PageSize,
|
||||
[property: JsonPropertyName("total")] int? Total);
|
||||
|
||||
public sealed record LnmLinksetNormalized(
|
||||
[property: JsonPropertyName("purls")] IReadOnlyList<string>? Purls,
|
||||
[property: JsonPropertyName("aliases")] IReadOnlyList<string>? Aliases,
|
||||
[property: JsonPropertyName("purl")] IReadOnlyList<string>? Purl,
|
||||
[property: JsonPropertyName("versions")] IReadOnlyList<string>? Versions,
|
||||
[property: JsonPropertyName("ranges")] IReadOnlyList<object>? Ranges,
|
||||
[property: JsonPropertyName("severities")] IReadOnlyList<object>? Severities);
|
||||
@@ -26,16 +39,41 @@ public sealed record LnmLinksetNormalized(
|
||||
public sealed record LnmLinksetConflict(
|
||||
[property: JsonPropertyName("field")] string Field,
|
||||
[property: JsonPropertyName("reason")] string Reason,
|
||||
[property: JsonPropertyName("values")] IReadOnlyList<string>? Values);
|
||||
[property: JsonPropertyName("observedValue")] string? ObservedValue,
|
||||
[property: JsonPropertyName("observedAt")] DateTimeOffset? ObservedAt,
|
||||
[property: JsonPropertyName("evidenceHash")] string? EvidenceHash);
|
||||
|
||||
public sealed record LnmLinksetTimeline(
|
||||
[property: JsonPropertyName("event")] string Event,
|
||||
[property: JsonPropertyName("at")] DateTimeOffset? At,
|
||||
[property: JsonPropertyName("evidenceHash")] string? EvidenceHash);
|
||||
|
||||
public sealed record LnmLinksetProvenance(
|
||||
[property: JsonPropertyName("observationHashes")] IReadOnlyList<string>? ObservationHashes,
|
||||
[property: JsonPropertyName("toolVersion")] string? ToolVersion,
|
||||
[property: JsonPropertyName("policyHash")] string? PolicyHash);
|
||||
[property: JsonPropertyName("ingestedAt")] DateTimeOffset? IngestedAt,
|
||||
[property: JsonPropertyName("connectorId")] string? ConnectorId,
|
||||
[property: JsonPropertyName("evidenceHash")] string? EvidenceHash,
|
||||
[property: JsonPropertyName("dsseEnvelopeHash")] string? DsseEnvelopeHash);
|
||||
|
||||
public sealed record LnmLinksetQuery(
|
||||
[Required]
|
||||
[property: JsonPropertyName("advisoryId")] string AdvisoryId,
|
||||
[Required]
|
||||
[property: JsonPropertyName("source")] string Source,
|
||||
[property: JsonPropertyName("includeConflicts")] bool IncludeConflicts = true);
|
||||
[property: JsonPropertyName("source")] string? Source = null,
|
||||
[property: JsonPropertyName("includeConflicts")] bool IncludeConflicts = true,
|
||||
[property: JsonPropertyName("includeObservations")] bool IncludeObservations = false);
|
||||
|
||||
public sealed record LnmLinksetSearchRequest(
|
||||
[property: JsonPropertyName("purl")] IReadOnlyList<string>? Purl,
|
||||
[property: JsonPropertyName("cpe")] IReadOnlyList<string>? Cpe,
|
||||
[property: JsonPropertyName("ghsa")] string? Ghsa,
|
||||
[property: JsonPropertyName("cve")] string? Cve,
|
||||
[property: JsonPropertyName("advisoryId")] string? AdvisoryId,
|
||||
[property: JsonPropertyName("source")] string? Source,
|
||||
[property: JsonPropertyName("severityMin")] double? SeverityMin,
|
||||
[property: JsonPropertyName("severityMax")] double? SeverityMax,
|
||||
[property: JsonPropertyName("publishedSince")] DateTimeOffset? PublishedSince,
|
||||
[property: JsonPropertyName("modifiedSince")] DateTimeOffset? ModifiedSince,
|
||||
[property: JsonPropertyName("includeTimeline")] bool IncludeTimeline = false,
|
||||
[property: JsonPropertyName("includeObservations")] bool IncludeObservations = false,
|
||||
[property: JsonPropertyName("page")] int? Page = null,
|
||||
[property: JsonPropertyName("pageSize")] int? PageSize = null,
|
||||
[property: JsonPropertyName("sort")] string? Sort = null);
|
||||
|
||||
Reference in New Issue
Block a user