Git Product home page Git Product logo

jsonschema.swift's Introduction

Curassow

Build Status

Curassow is a Swift Nest HTTP Server. It uses the pre-fork worker model and it's similar to Python's Gunicorn and Ruby's Unicorn.

It exposes a Nest-compatible interface for your application, allowing you to use Curassow with any Nest compatible web frameworks of your choice.

Documentation

Full documentation can be found on the Curassow website: https://curassow.fuller.li

Usage

To use Curassow, you will need to install it via the Swift Package Manager, you can add it to the list of dependencies in your Package.swift:

import PackageDescription

let package = Package(
  name: "HelloWorld",
  dependencies: [
    .Package(url: "https://github.com/kylef/Curassow.git", majorVersion: 0, minor: 6),
  ]
)

Afterwards you can place your web application implementation in Sources and add the runner inside main.swift which exposes a command line tool to run your web application:

import Curassow
import Inquiline


serve { request in
  return Response(.ok, contentType: "text/plain", body: "Hello World")
}

Then build and run your application:

$ swift build --configuration release

Example Application

You can find a hello world example application that uses Curassow.

License

Curassow is licensed under the BSD license. See LICENSE for more info.

jsonschema.swift's People

Contributors

amorde avatar cwagdev avatar dependabot-preview[bot] avatar dependabot[bot] avatar janrose-gcx avatar kylef avatar timothychilvers avatar valself avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jsonschema.swift's Issues

Swift 4 compiler warning

Now getting the following warning when using master branch for swift 3 compatibility:
/Pods/JSONSchema/Sources/Validators.swift:282:34: Bridging '[NSNumber]' to '[Bool]' may fail at runtime and will become a checked cast in Swift 4; did you mean to use 'as!' to force downcast?
For the following line:
let booleans = numerBooleans as [Bool]

Document usage better in readme

I propose to updated the readme to make these use cases clearer:

  • how to load a schema embedded in the app?
  • how to load a schema via a (public) url?
  • based on a swift model that is compliant with (en)Codable, take this model, serialize is to json, and validate it to one of the above schemas

(I'm staring at the code now for 15min trying to figure this out based on the test cases....)

Refactor everything

We should parse sub-schemas at any level as Schema structures, this will simplify validatorForReference since we can just call down the children.

Swift 4 & Xcode 9.2 incompatibility

It seems that this is not compatible with the default versions of Swift included from Xcode 9.2 onwards -- gives all sorts of errors. Any plans for a fix?

Not compiling

Create a new project and pod 'JSONSchema'

After pod install in a fresh project and compile. It is showing, No reference to this variables error..

Screenshot 2021-10-07 at 4 36 54 PM

Thread 1: EXC_BAD_ACCESS (code=EXC_I386_GPFLT)

Hi Team ,
I have one custom framework where I am using pod JsonSchema for validation. And same framework is used inside application. Application is crashing while accessing the code for validation. This is the error Thread 1: EXC_BAD_ACCESS (code=EXC_I386_GPFLT). I have attach the screen shot for your reference.

JsonSchemaError

.

Generate Swift class using JSON Schema

Feature Request:

I can't seem to find a library that will generate Swift classes from JSON schema yet. If you were to implement this feature it would set your project apart from the other JSON schema validators out there.

Swift 4 PackageManager support

In it's current state JSONSchema cannot be added as a Swift dependency in a Package.swift (https://swift.org/package-manager/) due to the contents of the /Tests folder, It results in a "package has unsupported layout; found loose source files" error. I also can't get this to build using Swift 4, is there official support for this? The commit history insinuates this. Thanks in advance for clarifying :)

Add Support for WatchOS

Currently, when I try to install JSONSchema for WatchOS target via CocoaPods it says it does not support WatchOS. I see no reason why it should not support it, or I'm wrong?

[!] The platform of the target 'TestApp_WatchUITests' (watchOS 9.0) is not compatible with 'JSONSchema (0.6.0)', which does not support 'watchOS'.

Excess properties in invalid ValidationResult

Hello.
Don't know if it's intended or not, but invalid validation result contains all the properties on the same level, not only missing ones.

Here's an example (both 0.5.0 release and latest commit 2f0facb):

validate(["price": 34.99, "name": "test"], schema: ["required": ["price", "name", "id"]])
▿ ValidationResult
▿ invalid : 1 element
- 0 : "Required properties are missing '["price", "name", "id"]'"

Swift Package not working

I tried to add JSONSchema to my Swift package but JSONSchema can not be resolved: "product 'JSONSchema' required by package 'myLogger' target 'MyLoggerTests' not found."

The package has been downloaded but the name can't be resolved.

import PackageDescription

let package = Package(
    name: "MyLogger",
    platforms: [
           .macOS(.v10_15),
           .iOS(.v17)
        ],
    products: [
        .library(
            name: "MyLogger",
            targets: ["MyLogger"]),
    ],
    dependencies: [
        // Add the JSONSchema.swift repo as a dependency
        .package(url: "https://github.com/kylef/JSONSchema.swift.git", from: "0.6.0"),
    ],
    targets: [
        .target(
            name: "MyLogger",
            dependencies: []),
        .testTarget(
            name: "MyLogger Tests",
            dependencies: ["Swift-Verification-Logger", "JSONSchema"]),
    ]
)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.