Skip to content

Commit

Permalink
fix: schema extraction object type name (#6014)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgulseth committed Mar 18, 2024
1 parent 2f16c94 commit dcd5537
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 36 deletions.
2 changes: 1 addition & 1 deletion packages/@sanity/schema/src/sanity/extractSchema.ts
Expand Up @@ -219,7 +219,7 @@ export function extractSchema(
return {type: 'unknown'} satisfies UnknownTypeNode
}

if (schemaType.type?.name !== 'document') {
if (schemaType.type?.name !== 'document' && schemaType.name !== 'object') {
attributes._type = {
type: 'objectAttribute',
value: {
Expand Down
Expand Up @@ -1334,13 +1334,6 @@ Array [
"type": "objectAttribute",
"value": Object {
"attributes": Object {
"_type": Object {
"type": "objectAttribute",
"value": Object {
"type": "string",
"value": "object",
},
},
"blocks": Object {
"optional": true,
"type": "objectAttribute",
Expand Down Expand Up @@ -1797,13 +1790,6 @@ Array [
"value": Object {
"of": Object {
"attributes": Object {
"_type": Object {
"type": "objectAttribute",
"value": Object {
"type": "string",
"value": "object",
},
},
"author": Object {
"optional": true,
"type": "objectAttribute",
Expand Down Expand Up @@ -1953,13 +1939,6 @@ Array [
"value": Object {
"of": Object {
"attributes": Object {
"_type": Object {
"type": "objectAttribute",
"value": Object {
"type": "string",
"value": "object",
},
},
"aNumber": Object {
"optional": true,
"type": "objectAttribute",
Expand Down Expand Up @@ -2555,13 +2534,6 @@ Array [
"value": Object {
"of": Object {
"attributes": Object {
"_type": Object {
"type": "objectAttribute",
"value": Object {
"type": "string",
"value": "object",
},
},
"aNumber": Object {
"optional": true,
"type": "objectAttribute",
Expand Down Expand Up @@ -2618,13 +2590,6 @@ Array [
"type": "objectAttribute",
"value": Object {
"attributes": Object {
"_type": Object {
"type": "objectAttribute",
"value": Object {
"type": "string",
"value": "object",
},
},
"blocks": Object {
"optional": true,
"type": "objectAttribute",
Expand Down

0 comments on commit dcd5537

Please sign in to comment.