Skip to content

Create a custom component

Request

Creates a custom component

Security
bearerAuth
Bodyapplication/jsonrequired

To create a custom component the name, title and url field is required.
Only users with the “library_manager” permission can create a custom component.
Allowable values of forgeId(Optional) are
1 : Other(This will be used as default when none is supplied) | 2 : SourceForge | 3 : Apache | 5 : MySQL AB | 11 : kernel.org | 53 : Mozilla | 78 : Java.net | 87 : GNU | 175 : Free Software Directory | 176 : CodePlex | 186 : Savannah | 248 : CPAN | 419 : Google Code | 628 : Ibiblio Maven2 | 696 : GitHub | 2033 : NuGet Gallery | 2037 : npm |2039 : RubyGems | 2040 : CentOS Project | 2067 : PyPI | 2070 : Packagist | 2073 : Google's Maven Repository | 2076 : crates.io

namestring, [ 0 .. 127 ] characters^[a-zA-Z0-9\.\_\-]+$required

name

Example:"Comp1"
titlestring, [ 0 .. 255 ] charactersrequired

title

Example:"Component1"
urlstring, [ 0 .. 2400 ] characters(NA|^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=...required

url

Example:"http://abc@xyz.com | NA"
descriptionstring, [ 0 .. 65535 ] characters

description

Example:"This is a custom component."
encryptionstringYES|NO

encryption

Enum:"YES""NO"
Example:"E.g. YES | default: NO"
forgeIdinteger, (int32), >= 1

forgeId

purlstring, [ 0 .. 2400 ] characters(^$|^(?i:NA|N/A)$|^pkg:[a-zA-Z0-9\+\-\.]+\/.*)

purl

Example:"pkg:maven/org.apache/commons-lang3 | N/A | NA"
curl -i -X POST \
  https://codeinsightapi.redocly.app/_mock/swagger/components \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Comp1",
    "title": "Component1",
    "url": "http://abc@xyz.com | NA",
    "description": "This is a custom component.",
    "encryption": "E.g. YES | default: NO",
    "forgeId": 1,
    "purl": "pkg:maven/org.apache/commons-lang3 | N/A | NA"
  }'

Responses

Created