Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Moving sample protos around, adding some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris H (CruftMaster) committed Apr 24, 2017
1 parent 98c7732 commit 4faeea2
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 14 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
default: darwin linux windows

darwin:
GOOS=darwin GOARCH=amd64 go build -o protoc-gen-jsonschema.darwin-amd64

linux:
GOOS=linux GOARCH=amd64 go build -o protoc-gen-jsonschema.linux-amd64

windows:
GOOS=windows GOARCH=amd64 go build -o protoc-gen-jsonschema.windows-amd64.exe
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ Links

Sample protos (for testing)
---------------------------
* Proto with a simple (flat) structure: [samples.PayloadMessage](PayloadMessage.proto)
* Proto containing a nested object (defined internally): [ssamples.NestedObject](NestedObject.proto)
* Proto containing a nested message (defined in a different proto file): [samples.NestedMessage](NestedMessage.proto)
* Proto containing an array of a primitive types (string, int): [samples.ArrayOfPrimitives](ArrayOfPrimitives.proto)
* Proto containing an array of objects (internally defined): [samples.ArrayOfObjects](ArrayOfObjects.proto)
* Proto containing an array of messages (defined in a different proto file): [samples.ArrayOfMessage](ArrayOfMessage.proto)
* Proto containing multi-level enums (flat and nested and arrays): [samples.Enumception](Enumception.proto)
* Proto containing a stand-alone enum: [samples.ImportedEnum](ImportedEnum.proto)
* Proto containing 2 stand-alone enums: [samples.FirstEnum, samples.SecondEnum](SeveralEnums.proto)
* Proto containing 2 messages: [samples.FirstMessage, samples.SecondMessage](SeveralMessages.proto)
* Proto with a simple (flat) structure: [samples.PayloadMessage](testdata/proto/PayloadMessage.proto)
* Proto containing a nested object (defined internally): [samples.NestedObject](testdata/proto/NestedObject.proto)
* Proto containing a nested message (defined in a different proto file): [samples.NestedMessage](testdata/proto/NestedMessage.proto)
* Proto containing an array of a primitive types (string, int): [samples.ArrayOfPrimitives](testdata/proto/ArrayOfPrimitives.proto)
* Proto containing an array of objects (internally defined): [samples.ArrayOfObjects](testdata/proto/ArrayOfObjects.proto)
* Proto containing an array of messages (defined in a different proto file): [samples.ArrayOfMessage](testdata/proto/ArrayOfMessage.proto)
* Proto containing multi-level enums (flat and nested and arrays): [samples.Enumception](testdata/proto/Enumception.proto)
* Proto containing a stand-alone enum: [samples.ImportedEnum](testdata/proto/ImportedEnum.proto)
* Proto containing 2 stand-alone enums: [samples.FirstEnum, samples.SecondEnum](testdata/proto/SeveralEnums.proto)
* Proto containing 2 messages: [samples.FirstMessage, samples.SecondMessage](testdata/proto/SeveralMessages.proto)
7 changes: 5 additions & 2 deletions generate-samples.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/usr/bin/env bash
PROTO_DIR="samples/proto"
JSONSCHEMA_DIR="samples/jsonschema"
PROTO_DIR="testdata/proto"
JSONSCHEMA_DIR="jsonschemas"
PATH=$PATH:.

# Ensure that the JSONSchema directory exists
mkdir -p $JSONSCHEMA_DIR

# Generate all of the files:
for PROTO_FILE in `ls ${PROTO_DIR}/*.proto`
do
Expand Down
2 changes: 1 addition & 1 deletion protoc_gen_jsonschema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

var (
protocBinary = "/bin/protoc"
sampleProtoDirectory = "samples/proto"
sampleProtoDirectory = "testdata/proto"
sampleProtos = make(map[string]SampleProto)
)

Expand Down
1 change: 0 additions & 1 deletion samples/jsonschema/README.md

This file was deleted.

6 changes: 6 additions & 0 deletions testdata/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Test Data
=========

This package contains constants two sets of test data:
1) Proto definitions for various test cases. These define different types of messages and proto payloads which the test suite will attempt to compile.
2) The GoLang files contain consts which define the exact JSONSchemas which are expected to be generated by the tests.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 4faeea2

Please sign in to comment.