diff --git a/internal/schema/data.go b/internal/schema/data.go index e47c23e04c..d43b91014e 100644 --- a/internal/schema/data.go +++ b/internal/schema/data.go @@ -117,15 +117,9 @@ func (d *Data) Monomorphise(ref *Ref) (*Data, error) { } n.Type = t - case *Any, *Bool, *Bytes, *Data, *Ref, *Database, Decl, *Float, - IngressPathComponent, *IngressPathLiteral, *IngressPathParameter, - *Int, Metadata, *MetadataCalls, *MetadataConfig, *MetadataDatabases, *MetadataRetry, - *MetadataIngress, *MetadataCronJob, *MetadataAlias, *MetadataSecrets, *Module, - *Schema, *String, *Time, Type, *TypeParameter, *Unit, *Verb, *Enum, - *EnumVariant, Value, *IntValue, *StringValue, *TypeValue, Symbol, - Named, *TypeAlias, *Topic, *MetadataSubscriber, *MetadataTypeMap, - *MetadataEncoding, *MetadataPublisher, *MetadataSQLMigration, *DSNDatabaseConnector, *DatabaseRuntime, - DatabaseConnector, *AWSIAMAuthDatabaseConnector, *DatabaseRuntimeConnections, *MetadataArtefact, Provisioned: + case Type, Metadata, Value, IngressPathComponent, DatabaseConnector, + *Module, *Schema, *TypeParameter, *Verb, *Enum, *TypeAlias, *Topic, *Database, + *DatabaseRuntimeConnections, *Data, *EnumVariant, *DatabaseRuntime: } return next() }) diff --git a/internal/schema/jsonschema.go b/internal/schema/jsonschema.go index 80e58702de..b279fa8096 100644 --- a/internal/schema/jsonschema.go +++ b/internal/schema/jsonschema.go @@ -189,13 +189,9 @@ func nodeToJSSchema(node Node, refs map[RefKey]*Ref) *jsonschema.Schema { case *TypeAlias: return nodeToJSSchema(node.Type, refs) - case Decl, *Field, Metadata, *MetadataCalls, *MetadataConfig, *MetadataDatabases, *MetadataIngress, - *MetadataAlias, *MetadataSecrets, IngressPathComponent, *IngressPathLiteral, *IngressPathParameter, *Module, - *Schema, Type, *Database, *Verb, *EnumVariant, *MetadataCronJob, Value, - *StringValue, *IntValue, *TypeValue, *Config, *Secret, Symbol, Named, - *MetadataRetry, *Topic, *MetadataSubscriber, *MetadataTypeMap, - *MetadataEncoding, *MetadataPublisher, *MetadataSQLMigration, *DSNDatabaseConnector, *DatabaseRuntime, - *AWSIAMAuthDatabaseConnector, DatabaseConnector, *DatabaseRuntimeConnections, *MetadataArtefact, Provisioned: + case Metadata, IngressPathComponent, DatabaseConnector, Type, Value, + *Module, *Field, *Schema, *Database, *Verb, *EnumVariant, + *Config, *Secret, *Topic, *DatabaseRuntime, *DatabaseRuntimeConnections: panic(fmt.Sprintf("unsupported node type %T", node)) default: diff --git a/internal/schema/validate.go b/internal/schema/validate.go index 77e5d742cb..a37575b6a3 100644 --- a/internal/schema/validate.go +++ b/internal/schema/validate.go @@ -216,15 +216,11 @@ func ValidateModuleInSchema(schema *Schema, m optional.Option[*Module]) (*Schema } return next() - case *Array, *Bool, *Bytes, *Data, Decl, *Field, *Float, - IngressPathComponent, *IngressPathLiteral, *IngressPathParameter, - *Int, *Map, Metadata, *MetadataCalls, *MetadataConfig, *MetadataDatabases, *MetadataCronJob, - *MetadataIngress, *MetadataAlias, *MetadataSecrets, *Module, *Optional, *Schema, *TypeAlias, - *String, *Time, Type, *Unit, *Any, *TypeParameter, *EnumVariant, *MetadataRetry, - Value, *IntValue, *StringValue, *TypeValue, *Config, *Secret, Symbol, Named, - *MetadataSubscriber, *Topic, *MetadataTypeMap, *MetadataEncoding, *MetadataPublisher, - *MetadataSQLMigration, *DSNDatabaseConnector, *DatabaseRuntime, DatabaseConnector, - *AWSIAMAuthDatabaseConnector, *DatabaseRuntimeConnections, *MetadataArtefact, Provisioned: + case + IngressPathComponent, Metadata, Value, Type, DatabaseConnector, + *Module, *Optional, *Schema, *TypeAlias, *String, *Time, *Unit, *Any, *TypeParameter, + *EnumVariant, *Config, *Secret, *Topic, *DatabaseRuntime, *DatabaseRuntimeConnections, + *Data, *Field: } return next() }) @@ -360,16 +356,10 @@ func ValidateModule(module *Module) error { n.Catch.Module = module.Name } - case *Array, *Bool, *Database, *Float, *Int, - *Time, *Map, *Module, *Schema, *String, *Bytes, - *MetadataCalls, *MetadataConfig, *MetadataDatabases, *MetadataIngress, *MetadataCronJob, *MetadataAlias, - *MetadataSecrets, IngressPathComponent, *IngressPathLiteral, *IngressPathParameter, *Optional, - *Unit, *Any, *TypeParameter, *Enum, *EnumVariant, *IntValue, *StringValue, *TypeValue, - *Config, *Secret, *MetadataSubscriber, *MetadataTypeMap, *MetadataEncoding, *MetadataPublisher, - *MetadataSQLMigration, *DSNDatabaseConnector, *DatabaseRuntime, *AWSIAMAuthDatabaseConnector, - *MetadataArtefact, DatabaseConnector, *DatabaseRuntimeConnections, Provisioned: - - case Named, Symbol, Type, Metadata, Value, Decl: // Union types. + case Type, Metadata, Value, IngressPathComponent, DatabaseConnector, + *Module, *Schema, *Optional, *TypeParameter, *EnumVariant, + *Config, *Secret, *DatabaseRuntime, *DatabaseRuntimeConnections, + *Database, *Enum: } return next() })