Skip to content

Item 38 : Added missing New-SchemaBoolean function and supporting help #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,73 @@
# Changelog

All changes to this module should be reflected in this document.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

## [2.0.0] - 2020-12-22

### Added

- Added classes to define JSON schema objects
- Added utility methods to classes
- Added Functions to support the classes
- New-SchemaElement
- New-SchemaString
- New-SchemaInteger
- New-SchemaNumber
- New-SchemaProperty
- Get-SchemaDefinition
- Get-SchemaReference
- Find-SchemaElement
- ConvertTo-SchemaElement
- ConvertFrom-SchemaObject
- ConvertFrom-SchemaArray
- Format-SchemaDocument
- Added support for types (schema.types.ps1xml)
- Added support for formatting (schema.format.ps1xml)

### Updated

- Get-SchemaDocument has been udpated to work with the new functions

### Removed

- Get-SchemaArray
- Get-SchemaObject
- Get-SchemaProperty

## [1.1.0] - 2020-09-11

### Added

- Updatable Help Support

## [1.0.0] - 2020-09-09

### Added

- Updated documentation and external help
- CHNAGELOG added
- psakefile added
- Added JSON logo

### Changed

- README
- Definition File updated with URLs and new version

### Fixed

- Missing some JSON data types, bool and int
- Write-Verbose acts different for arrays, so corrected the output

## [0.0.1] - 2020-09-08

### Added

- Repository Created
- Module manifest created
- Module file copied from outside repository
Expand Down
190 changes: 190 additions & 0 deletions docs/New-SchemaBoolean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
---
external help file: schema-help.xml
Module Name: schema
online version: https://github.com/SchemaModule/PowerShell/blob/master/docs/New-SchemaBoolean.md#new-schemaboolean
schema: 2.0.0
---

# New-SchemaBoolean

## SYNOPSIS

A function to create new Schema Boolean object

## SYNTAX

```
New-SchemaBoolean [-id <String>] [-ref <String>] [-title <String>] [-description <String>] [-default <Boolean>]
[-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION

A function to create new Schema Boolean object

## EXAMPLES

### Example 1

```powershell
New-SchemaBoolean -title ExteriorAccess -description "Does the room have an exterior door" -default $false


$id :
title : ExteriorAccess
description : Does the room have an exterior door
default : False
```

A simple example of usage

## PARAMETERS

### -default

The default keyword specifies a default value for an item.

```yaml
Type: System.Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -description

The title and description keywords must be strings. A "description" will provide
a more lengthy explanation about the purpose of the data described by the schema

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -id

The $id property is a URI-reference that serves two purposes, it declares a
unique identifier for the schema and it declares a base URI against which $ref
URI-references are resolved.

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ref

The $id property is a URI-reference that serves two purposes, it declares a
unique identifier for the schema and it declares a base URI against which $ref
URI-references are resolved.

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -title

The title and description keywords must be strings. A "title" will preferably be
short explanation about the purpose of the data described by the schema.

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Confirm

Prompts you for confirmation before running the cmdlet.

```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -WhatIf

Shows what would happen if the cmdlet runs.
The cmdlet is not run.

```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

### None

## OUTPUTS

### schemaBoolean

The boolean type matches only two special values: true and false. Note that
values that evaluate to true or false, such as 1 and 0, are not accepted by
the schema.

[Schema Boolean](http://json-schema.org/understanding-json-schema/reference/boolean.html)

[Schema Types](https://json-schema.org/understanding-json-schema/reference/type.html)

## NOTES

## RELATED LINKS

[New-SchemaElement](https://github.com/SchemaModule/PowerShell/blob/master/docs/New-SchemaElement.md#new-schemaelement)

[About Classes](https://github.com/SchemaModule/PowerShell/blob/master/docs/about_Schema_Classes.md)

[JSON Schema Reference](https://json-schema.org/understanding-json-schema/reference/index.html)
4 changes: 4 additions & 0 deletions docs/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ A function to follow the ref keyword and return the referenced schema

A function to create new Schema Integer object

### [New-SchemaBoolean](New-SchemaBoolean.md)

A function to create new Schema Boolean object

### [New-SchemaNumber](New-SchemaNumber.md)

A function to create new Schema Number object
Expand Down
Loading