Skip to content

Commit

Permalink
bump rc3
Browse files Browse the repository at this point in the history
  • Loading branch information
bhelx committed Aug 2, 2024
1 parent adb4f77 commit 413b4ef
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dylibso/xtp-bindgen",
"version": "1.0.0-rc.2",
"version": "1.0.0-rc.3",
"description": "XTP bindgen helper library",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function isJsonEncoded(p: Parameter | null): boolean {

function isUtf8Encoded(p: Parameter | null): boolean {
if (!p) return false
return p.contentType === 'text/plain; charset=UTF-8'
return p.contentType === 'text/plain; charset=utf-8'
}

function isPrimitive(p: Property): boolean {
Expand Down
6 changes: 5 additions & 1 deletion src/normalizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export interface XtpItemType extends Omit<parser.XtpItemType, '$ref'> {
'$ref': Schema | null;
}

export interface Property extends Omit<parser.Property, '$ref' | 'contentType'> {
export interface Property extends Omit<parser.Property, '$ref'> {
'$ref': Schema | null;
nullable: boolean;
items?: XtpItemType;
Expand Down Expand Up @@ -93,6 +93,10 @@ function normalizeProp(p: Parameter | Property | XtpItemType, s: Schema) {
p.$ref = s
p.type = s.type || 'string' // TODO: revisit string default, isn't type required?
p.description = p.description || s.description
// double ensure that content types are lowercase
if ('contentType' in p) {
p.contentType = p.contentType.toLowerCase() as MimeType
}
}

function normalizeV1Schema(parsed: parser.V1Schema): XtpSchema {
Expand Down
2 changes: 1 addition & 1 deletion src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export interface CodeSample {
label?: string;
}

export type MimeType = 'application/json' | 'text/plain; charset=UTF-8' | 'application/x-binary'
export type MimeType = 'application/json' | 'text/plain; charset=utf-8' | 'application/x-binary'

export interface Schema {
description: string;
Expand Down

0 comments on commit 413b4ef

Please sign in to comment.